REGEXP_SUBSTR

Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API

Returns the substring matching a regular expression pattern.

  • <string>: The string to search within.
  • <pattern>: The regular expression pattern to match.

Returns a text value containing the matched substring, or NULL if no match is found.

Extract a sequence of digits from a string.

Returns '123'.

Returns NULL when pattern is not found.

Returns NULL.

Extract the domain from an email address.

Returns '@example.com'.

Extract a word pattern.

Returns '$99.99', because the digit string is considered a word.

Provide a default when no match.

Returns the matched digits or '0' if none are found.