The result from REGEXTEST is TRUE or FALSE.

To use REGEXTEST, provide text and a pattern.

While regular expressions can be intimidating to new users, they are widely used in many programming languages.

REGEXTEST function - basic examples

Compared to the simplewildcardsprovided in older versions of Excel, regular expressions are a giant upgrade.

They make it possible to match text in extremely specific ways that were simply not possible before now.

Note that the formulas below use literal strings instead of cell references for readability.

REGEXTEST function - basic examples

In each case, the text being tested remains the same; only the pattern varies.

REGEXTEST returns TRUE because the literal string “apple” appears in the text.

Note that REGEXTEST automatically performs a “contains” bang out search.

REGEXTEST function - basic examples

REGEXTEST returns TRUE because the literal string “a” appears in the text.

REGEXTEST returns TRUE because the text string “1apple23#z” begins with a “1”.

The caret (^) is a metacharacter that matches thebeginningof a text string.

REGEXTEST function - basic examples

REGEXTEST returns FALSE because the text does not begin with “a”.

REGEXTEST returns FALSE because the text does not end with an uppercase “Z”.

The dollar ($) is a metacharacter that matches theendof a text string.

REGEXTEST function - basic examples

REGEXTEST returns FALSE because the text contains no uppercase character between “A” and “Z”.

REGEXTEST returns TRUE because the text contains the digit “1”.

REGEXTEST returns TRUE because the text contains a two-digit number where each digit is between 0-9.

REGEXTEST function - alternation example (OR logic)

REGEXTEST returns TRUE because the text contains the punctuation “#”.

By grouping alternatives within parentheses, you might match one of several patterns in a test string.

Regex terminology

Because Regex is essentially a mini-language, it has its own vocabulary.

Excel formula: Cell contains specific text

By default, REGEXREPLACE will…

Excel formula: Validate strong password

Excel REGEXEXTRACT function

Excel REGEXREPLACE function

REGEXTEST function - basic examples

REGEXTEST function - alternation example (OR logic)