REGEXMATCH in Google Sheets
Returns TRUE if a text contains a pattern (a regular expression).
Syntax
REGEXMATCH(text, regular_expression)- text
- The text to search. It must be text; a number gives #VALUE!.
- regular_expression
- The pattern in quotes, such as "\d+" for one or more digits.
Examples
C1
=REGEXMATCH(1A2,2"\d+")| A | B | C | |
|---|---|---|---|
| 1 | Note | TRUE | |
| 2 | Order 1001 |
In plain words: TRUE when 1the note in A2 contains 2at least one digit.
C1=REGEXMATCH(A2,"^DK")
| A | B | C | |
|---|---|---|---|
| 1 | ZIP code | FALSE | |
| 2 | SE-111 22 |