REGEXP_EXTRACT_ALL
Written by
Updated at July 15, 2024
Syntax
REGEXP_EXTRACT_ALL( string, pattern )
Description
Returns all string
substrings matching the pattern
regex. For regexes with subgroups, it only works for the first subgroup.
Argument types:
string
—String
pattern
—String
Return type: Array of strings
Note
Only constant values are accepted for the arguments (pattern
).
Note
See the documentation of the data source to clarify the regular expression syntax. For example, ClickHouse
uses the RE2 syntax
Example
REGEXP_EXTRACT_ALL("100-200, 300-400", "(\d+)-(\d+)") = ["100","300"]
Data source support
ClickHouse 21.8
, PostgreSQL 9.3
.