REGEXP_EXTRACT

Finds the first match of the regular expression pattern in string and returns the capturing group number requested.

Syntax

REGEXP_EXTRACT(string, pattern, group)

Arguments

Returns

When the group argument is excluded, this function returns the first substring matched by the regular expression pattern in the string.

If the group argument is included, the function finds the first occurrence of the regular expression pattern in the string and returns the capturing group number group.


Examples

Last updated