Fields / Formula / function
MatchesPattern
Whether the WHOLE text matches the pattern (a regular expression).
Syntax
MatchesPattern(text, pattern)Returns
Boolean (null when the pattern is blank).
Example
MatchesPattern(Phone, "\+?[0-9 ()-]{7,20}")Notes and limitations
The whole value must match: MatchesPattern(Code, "[0-9]{10}") is true for 5551234567 and false for "call 5551234567" (use ContainsPattern for that). A blank text gives False. A pattern typed into the formula is checked when it is saved; one taken from a field is checked when the formula runs. Patterns are at most 1,000 characters. Matching never gets stuck on a long text; the few pattern features that could make it slow -- look-behind such as (?<=a) and back-references such as \1 -- are not supported and are refused. To ignore capitals, allow both in the pattern ([a-zA-Z]) or start it with (?i).