Skip to content
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.

  1. Is this a well-formed email address?

    =REGEXMATCH(B2, "^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$")

    ResultTRUE

  2. Only 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.