Regular Expression Functions

Use the regular expression functions to perform pattern matching to extract, count, and perform other manipulations on strings.

FunctionReturn TypeInput ArgumentsDescription
regexp_count({s}, {regex})Bigint
  • s: String
  • regex: Regex pattern
Returns the number of occurrences of the regular expression pattern in the string.
regexp_extract({s}, {regex})Varchar
  • s: String
  • regex: Regex pattern
Returns the first occurrence of the regular expression pattern in the string.
regexp_extract_all({s}, {regex})String
  • s: String
  • regex: Regex pattern
Returns all the occurrences of the regular expression pattern in the string.
regexp_like({s}, {regex})Boolean
  • s: String
  • regex: Regex pattern
Determines if the regular expression pattern is contained within the string.
regexp_position({s}, {regex})Integer
  • s: String
  • regex: Regex pattern
Returns the index of the first occurrence of the regular expression pattern in the string.
regexp_replace({s}, {regex}, {replacement})Varchar
  • s: String
  • regex: Regex pattern
  • replacement: String (optional)
Removes every sub string matched by the regular expression pattern from the string. If a replacement is supplied, each match is replaced by the replacement.
regexp_split({s}, {regex})Array
  • s: String
  • regex: Regex pattern
Splits an input string using the regular expression pattern and returns an array.