What is REGEXMATCH in Google Sheets?
REGEXMATCH returns TRUE or FALSE when text matches a regular expression pattern. Use it in FILTER, IF, and COUNTIF to validate emails, extract structure flags, or flag messy imports before they break downstream reports.
When to use it
Use REGEXMATCH when simple wildcards are not enough: validate formats, detect digits-only fields, or filter rows matching a pattern.
When to skip it
Skip REGEXMATCH for basic contains checks. SEARCH or simple = may be faster to read for teammates.
How it works
-
1
Put the text cell or expression as the first argument.
-
2
Write a regex pattern string as the second argument.
-
3
Anchor patterns with ^ and $ when the whole cell must match.
-
4
Combine with FILTER to return rows where REGEXMATCH is TRUE.
-
5
Escape special regex characters when matching literals.
-
6
Test patterns in a scratch column before wrapping in FILTER.
Examples in Google Sheets
Email shape check
=REGEXMATCH(A2, "^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$") flags plausible email formatting.
Digits only SKU
=REGEXMATCH(B2, "^\d+$") verifies SKU is numeric before VLOOKUP.
FILTER valid rows
=FILTER(Data!A:D, REGEXMATCH(Data!C:C, "invoice-\d+")) keeps invoice-coded rows.
Better Sheets resources
Common mistakes
-
Forgetting to double-escape backslashes in regex strings inside formulas.
-
Using REGEXMATCH without anchors so partial substring matches surprise you.
-
Case sensitivity surprises when pattern lacks (?i) or explicit case classes.
-
Regex on numbers without TEXT conversion first.
-
Overly complex patterns nobody can maintain six months later.
Frequently asked questions
- REGEXMATCH vs COUNTIF wildcard?
- REGEXMATCH supports full regex power. COUNTIF wildcards are simpler but limited.
- Case insensitive REGEXMATCH?
- Use character classes or inline flags supported by Google Sheets regex engine.
- REGEXMATCH on arrays?
- Yes. It spills TRUE/FALSE down when the text argument is a range.
- Why always FALSE?
- Check escaping, anchors, and whether the cell has hidden spaces. TRIM first.
- REGEXMATCH with IF?
- =IF(REGEXMATCH(A2, pattern), "OK", "Fix") labels validation per row.
- REGEXMATCH and QUERY?
- QUERY has limited regex. FILTER plus REGEXMATCH is common instead.
- Performance on big columns?
- Regex per row on tens of thousands of lines can slow recalc.
Related Tutorials
Watch how REGEXMATCH works
200 REGEXMATCH Examples in Google Sheets
REGEXMATCH Formula Generator for Google Sheets
Related blog posts
Guides that explain REGEXMATCH in more depth.
Philippines Phone Number Validation: Use of REGEXMATCH in Google Sheets
Every school year thousands of students and teachers’ data were being added to the school database. As someone who was always given the task to narrow down lots of information after the school enrollment, validating students’ data manually is very exhausting. Take this as an example, when you ask students to include the phone numbers of their emergency contact person, there are some instances wherein the declared numbers were invalid due to human error. And the assigned personnel during enr...
Read post →One Sheet, Two Counts: A Root-Domain Check in Google Sheets
A list of websites can give you two numbers at once, and neither is the number of sites on it. Pull the root domain out of each URL, count unique roots next to the row count, and match two lists on the root. A guest post by Ivan Trefilov.
Read post →Related terms
REGEXEXTRACT
REGEXEXTRACT returns the portion of text that matches a regular expression, often using capture groups to pull IDs, domains, or codes from longer strings. It replaces manual LEFT/RIGHT/MID chains when patterns repeat.
Read guide →REGEXREPLACE
REGEXREPLACE finds text matching a regex pattern and replaces it with new text. Strip non-digits from phones, normalize spaces, or remove tags from HTML snippets in bulk without one-off find-and-replace menus.
Read guide →SPLIT
SPLIT divides one text cell into multiple cells spilled across columns using a delimiter such as comma, space, or custom string. It is the formula version of Text to columns for live data like tags, full names, or combined codes.
Read guide →FILTER
FILTER returns only the rows from a range that meet one or more conditions. Conditions are boolean arrays the same height as the data. FILTER spills results automatically, so it replaced many INDEX/SMALL helper-column patterns for live subsets.
Read guide →Done reading about REGEXMATCH?
Membership unlocks 600+ tutorials, unlimited generators, and every template. Practical lessons. Zero fluff.
Need this once
Jump to a free tool or a single tutorial for this topic.
Learning Sheets for real
Unlock the full library, generators, and templates with membership.