REGEX_MATCH

Checks if a text string matches a specified regular expression pattern

Description

The REGEX_MATCH() function is used to determine if a text string matches a specific regular expression pattern. This function is valuable for pattern validation and identifying occurrences of a particular pattern within text data.

Syntax

REGEX_MATCH(text, "pattern")

  1. text: The input text string you want to check for a pattern match.

  2. pattern: The regular expression pattern to be used for the match check.

Example

Table

ID
Phone Numbers

1

(555) 555-5555

2

123-456-7890

3

800-555-1234 ext. 567

4

+1 (123) 456-7890

Function

REGEX_MATCH(`Phone Numbers`, "^[+]?[0-9]?[-. ]?\\(?[0-9]{3}\\)?[-. ]?[0-9]{3}[-. ]?[0-9]{4}$")

Results

REGEX_MATCH (boolean)

Last updated