REGEX Formula Generator (Google Sheets)
Google Sheets has three regex functions: REGEXEXTRACT (pull matched text), REGEXMATCH (test true/false), REGEXREPLACE (substitute). Sheets-only — Excel uses LEFT/MID/FIND or TEXTSPLIT instead.
Syntax
=REGEXEXTRACT(text, regex) / =REGEXMATCH(text, regex) / =REGEXREPLACE(text, regex, replacement)Try it — generate a REGEXEXTRACT / REGEXMATCH / REGEXREPLACE formula
Examples
Pull domain from an email
=REGEXEXTRACT(A2, "@(.+)")Captures everything after the @. Capture group in parentheses = the returned part.
Check if cell is a valid email
=REGEXMATCH(A2, "^[\w.-]+@[\w.-]+\.\w+$")Returns TRUE only if A2 matches a basic email pattern.
Strip non-digits from a phone
=REGEXREPLACE(A2, "[^0-9]", "")Replace every non-digit with empty → clean phone number.
Tips
- ✓Escape special chars in regex: \. for literal period, \\ for backslash.
- ✓REGEXEXTRACT without a capture group returns the whole match. With one, returns the group.
- ✓Not available in Excel — use TEXTSPLIT, LEFT, FIND combos there.
Related Formulas
Text Split / Extract
Split text into parts, extract substrings, or parse structured data like email a...
CONCATENATE / TEXTJOIN
Combine text from multiple cells into one. TEXTJOIN is the modern approach with ...
FILTER
FILTER returns rows from a range that meet specified conditions. It's like AutoF...
Need a different formula?
Describe any formula in plain English and FormulaPad will generate it.
Try FormulaPad Free