REGEXP_EXTRACT_ALL
Written by
Updated at November 6, 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
, Files
, Google Sheets
, PostgreSQL 9.3
, Yandex Documents
.