I’m struggling with making REGEXMATCH work without caring about uppercase and lowercase letters in Google Sheets. I’ve been trying to figure this out for a while now but I’m stuck.
I have a Google Sheets document where I’m using REGEXMATCH to check if text from one cell matches text in another cell. The problem is that it’s treating uppercase and lowercase letters as different, which I don’t want.
Here’s what I’m working with:
=REGEXMATCH(A5;"(?i)B5")
In cell A5 I have: “Project Management | Sarah”
In cell B5 I have: “project management”
Notice how A5 starts with capital P in “Project” but B5 has lowercase p in “project”. Even though I’m trying to use the (?i) flag to ignore case, my formula keeps returning FALSE.
I thought the (?i) flag would make it ignore the difference between uppercase and lowercase but it’s not working. What am I doing wrong here? Any help would be great since I’m new to this.
You’re putting the cell reference B5 inside quotes, so it’s literally searching for “B5” instead of using what’s actually in cell B5. Here’s the fix:
=REGEXMATCH(A5,"(?i)"&B5)
The & operator combines the case-insensitive flag “(?i)” with whatever text is in B5. Now Google Sheets will grab the actual content from B5 and do case-insensitive matching. I made this exact same mistake when I started with REGEXMATCH - mixing up cell references vs literal text in regex patterns trips everyone up at first.
yeah, that’s a common mistake - you’re treating B5 as literal text instead of a cell reference. try =REGEXMATCH(A5,"(?i)"&B5) without quotes around B5. the ampersand concatenates the case flag with your actual cell content. should work fine then.
Others already covered the syntax fix, but here’s a different approach that’ll save you future headaches.
Skip wrestling with Google Sheets regex entirely - just automate the whole thing. I’ve built workflows that pull data from Sheets, do case-insensitive matching, and update everything automatically.
Write the logic once and you’re done. Set it to trigger when your sheet changes, and you’ll never touch regex syntax again.
I’ve done this for employee directories, project sorting, and inventory tracking. Way more reliable than memorizing formulas every time.
For Google Sheets automation like this, Latenode makes it dead simple. Connect your sheet, set up the text matching with proper case handling, and let it run.
Had this exact problem last month building a client database. The concatenation approach above works, but here’s something that saved me hours of debugging - check for trailing spaces in your cells. Even with case-insensitive matching, whitespace will kill your matches. I started wrapping everything in TRIM() like =REGEXMATCH(TRIM(A5),"(?i)"&TRIM(B5)) after banging my head against the wall for hours. If you’re doing partial matches instead of exact ones, you’ll also want to escape special regex characters in your search term with a helper function.
The issue arises from how you’re referencing the cell. When you include (?i)B5 in quotes, it’s being treated as the literal text “B5” instead of pulling in the actual contents of cell B5. To fix this, use: =REGEXMATCH(A5,"(?i)"&B5). The ampersand is crucial as it connects the case-insensitive flag with the actual text in B5. I’ve faced this same challenge myself; once you get the syntax right, the (?i) flag functions properly. It should return TRUE for your example, as both A5 and B5 contain “project management”, albeit in different cases.