REGEXP_EXTRACT_ALL

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:

  • stringString
  • patternString

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 to compose regular expressions.

Example

REGEXP_EXTRACT_ALL("100-200, 300-400", "(\d+)-(\d+)") = ["100","300"]

Data source support

ClickHouse 21.8, PostgreSQL 9.3.