REGEXMATCH

Return TRUE if text matches a regular expression. The same function as REGEXTEST, under the name Google Sheets uses.

Syntax

REGEXMATCH(text, pattern, [case_sensitivity])
Argument Required Description
text Required The text to test.
pattern Required A regular expression.
case_sensitivity Optional 0 (the default) for case-sensitive matching, 1 to ignore case.

Examples

Every example below was executed against VisiGrid engine 0.54.0 — not transcribed from another vendor's documentation. Reproduce any of them with vgrid calc.

Formula Result Notes
=REGEXMATCH("Invoice 2041","\d+") TRUE
=REGEXMATCH("abc","B") FALSE
=REGEXMATCH("abc","B")=REGEXTEST("abc","B") TRUE Identical to REGEXTEST.

Why two names

Google Sheets has had REGEXMATCH for years; Excel added the same function in 2024 as REGEXTEST. VisiGrid accepts both, so a formula brought over from either keeps working.

In a sheet that may be opened in Excel, use REGEXTEST — Excel will not recognise REGEXMATCH.

Excel compatibility

Excel does not have REGEXMATCH; it calls this function REGEXTEST. Both names work here, so formulas from Google Sheets keep working.

Related functions

Last updated