REGEXMATCH() Function

This article explains how to use the REGEXMATCH() function

The REGEXMATCH function allows you to test whether a piece of text matches a regular expression. A regular expression (regex) is a sequence of characters in a special format that specifies how it should match with a piece of text. This wikipedia article explains the basics. There are also sites that help you with constructing and testing your regex e.g. regex101.

Note that regex are powerful, but also quite difficult. They can become complex and hard to maintain. Truly explaining regex is beyond the scope of this help document. If you are interested in learning more about regex, you can find many tutorials online. This document tries to get your started quickly with the REGEXMATCH function and assumes some familiarity with regex.

Syntax

FS
REGEXMATCH(<text>, <regular_expression>)

The function will return a logical value, TRUE or FALSE, based on if the text matches the specified regex pattern.

Examples

FS
REGEXMATCH("some text", "text") // checks whether the exact pattern "text" is included in the test string "some text" -> TRUE REGEXMATCH("abc", "a.c") // checks whether the text contains an "a" followed by anything followed by "c" exists -> TRUE REGEXMATCH("abNOT_C", "a.c") // checks whether the text contains an "a" followed by anything followed by "c" exists -> FALSE

Related articles

Learn more about regexmatch in one of the following articles