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)
| Argument | What it is |
|---|---|
| text | The text to test. |
| regular_expression | The 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.
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.
In B2, check whether the code is exactly three uppercase letters, a hyphen and three digits.
| A | B | C | |
|---|---|---|---|
| 1 | Code | Valid? | |
| 2 | ABC-123 | ||
| 3 | AB-1234 | ||
| 4 | XYZ-987 | ||
| 5 | abc-123 | ||
| 6 | WXYZ-1234 | ||
| 7 | QRS-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.