Google Sheets
REGEXMATCH function in Google Sheets
Whether a piece of text matches a regular expression.
=REGEXMATCH(text, regular_expression)REGEXMATCH syntax and parameters
Two arguments, two required.
- textstringRequired
The text to be tested against the regular expression.
- regular_expressionstringRequired
The regular expression to test the text against.
REGEXMATCH examples
Formulas you'll actually reuse.
Is this a well-formed email address?
=REGEXMATCH(B2, "^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$")Result
TRUEOnly the rows whose order code starts with the NYC prefix:
=FILTER(A2:C, REGEXMATCH(A2:A, "^NYC-"))
REGEXMATCH in Excel
No direct equivalent — here's the way around.
Try REGEXMATCH in the playground
Edit the example — nothing to install.
Preloaded with the REGEXMATCH formula from Example 1 — change anything and watch it respond.
Loading the editor…
REGEXMATCH errors
What they mean — and the fixes.
#VALUE!The pattern isn't valid RE2 — Sheets has no lookahead or lookbehind; check for an unbalanced bracket.
Related functions
More ways Google Sheets gets this done.
- ARABICComputes the value of a Roman numeral.TextExcel
- CHARConvert a number into a character according to the current Unicode table.TextExcel
- CLEANReturns the text with the non-printable ASCII characters removed.TextExcel
- CODEReturns the numeric Unicode map value of the first character in the string provided.TextExcel
- CONCATENATEAppends strings to one another.TextExcel
- DOLLARFormats a number into the locale-specific currency format.TextExcel