REGEX_EXTRACT_ALL

Description

Returns a tuple with all matched groups. If there are no matches, an empty tuple is returned.

Syntax

REGEX_EXTRACT_ALL(string_expression, regex)

Arguments

  string_expression - string expression

  regex - string expression indicating a regular expression

Examples

REGEX_EXTRACT_ALL('213.131.343.135:5020', '(.*)\\:(.*)') returns a tuple ('213.131.343.135','5020')

Notes

  • The regex string must be enclosed by single quotes.
  • Make sure to escape a single-quotes (i.e. \' )
  • Make sure to escape back-slashes that are part of a regular expression escape sequence (e.g. instead of \s as shorthand for whitespace, use \\s )

Return value datatype

Tuple

Impact of null value

If input is null, returns null.

Feedback and Knowledge Base