Regular Expression Functions
Use the regular expression functions to perform pattern matching to extract, count, and perform other manipulations on strings.
Function | Return Type | Input Arguments | Description |
---|---|---|---|
regexp_count({s}, {regex}) | Bigint |
| Returns the number of occurrences of the regular expression pattern in the string. |
regexp_extract({s}, {regex}) | Varchar |
| Returns the first occurrence of the regular expression pattern in the string. |
regexp_extract_all({s}, {regex}) | String |
| Returns all the occurrences of the regular expression pattern in the string. |
regexp_like({s}, {regex}) | Boolean |
| Determines if the regular expression pattern is contained within the string. |
regexp_position({s}, {regex}) | Integer |
| Returns the index of the first occurrence of the regular expression pattern in the string. |
regexp_replace({s}, {regex}, {replacement}) | Varchar |
| 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 |
| Splits an input string using the regular expression pattern and returns an array. |