Google Sheets REGEXMATCH function

Returns TRUE when a text matches a regular expression. It is a Sheets-only function. It has the same name in Spanish Sheets.

Syntax

English Sheets

=REGEXMATCH(text, regular_expression)

Spanish Sheets (Mexico locale)

=REGEXMATCH(texto, expresión_regular)

Spanish Sheets (Spain, Latin America)

=REGEXMATCH(texto; expresión_regular)

ArgumentWhat it is
textThe text to test.
regular_expressionThe pattern, like "^[A-Z]{3}-[0-9]{3}$".

Example

REGEXMATCH(text, expression) returns TRUE when the text matches a pattern. ^ marks the start and $ the end, [A-Z] is an uppercase letter, [0-9] a digit and {3} repeats three times. It is case-sensitive.

=REGEXMATCH(A2,"^[A-Z]{3}-[0-9]{3}$")

Common mistake

It is case-sensitive and only takes text: a number returns #VALUE!. Without ^ and $, the pattern can appear anywhere.

About Ads

This site uses Google AdSense to display ads. These ads help us keep WebHerramientas completely free. Ads are managed by Google and meet strict security and privacy standards.

Advertising
Loading ad...

Ads help us keep WebHerramientas free for everyone

Practice REGEXMATCH

Type the formula in the sheet and check it instantly. Spanish or English function names both work. See all lessons

REGEXMATCH

REGEXMATCH(text, expression) returns TRUE when the text matches a pattern. ^ marks the start and $ the end, [A-Z] is an uppercase letter, [0-9] a digit and {3} repeats three times. It is case-sensitive.

Example=REGEXMATCH(A2,"^[0-9]+$")REGEXMATCH: same name in Spanish

In B2, check whether the code is exactly three uppercase letters, a hyphen and three digits.

B2
ABC
1CodeValid?
2ABC-123
3AB-1234
4XYZ-987
5abc-123
6WXYZ-1234
7QRS-602
8

Tip: while typing, click a cell or drag across several to insert their reference.

Frequently asked questions

What is REGEXMATCH called in Spanish?
It has the same name: REGEXMATCH. Functions that started in Google Sheets keep their English name even in a Spanish spreadsheet. What changes is the separator: Spain and much of Latin America separate arguments with semicolons.
Why does REGEXMATCH use semicolons in some spreadsheets?
It depends on each spreadsheet's locale, under File > Settings. Where the comma is the decimal mark (Spain, much of South America), arguments are separated by semicolons. Mexico and United States locales use commas.
What is the most common REGEXMATCH mistake?
It is case-sensitive and only takes text: a number returns #VALUE!. Without ^ and $, the pattern can appear anywhere.