REGEXP_EXTRACT_ALL
Last updated: 9/21/2026Matches the regular expression on the input string. Returns the escape groups if any exists or the original string if none exists.
Syntax
REGEXP_EXTRACT_ALL(first, second)
Arguments
| Name | Type |
|---|---|
| first | string |
| second | string |
Returns
Returns the substrings(s) matched by the regular expression.
Examples
| first | second | Output |
|---|---|---|
| "abcdefabc" | "abc" | [abc, abc] |
| "1a2b3" | "\d+" | [1, 2, 3] |
| "Word" | "^((((((((((..)?.)?.)?.)?.)?.)?.)?.)?.)?.)?" | [Word, Wor, Wo, W] |
| "abab" | "abc" | null |
| null::string | "abc" | null |
| "abc" | '' | [, , , ] |
| array["ab1", "a2a", "345"] | "\d" | [1, 2, 3, 4, 5] |
| array["ab1", "a2a", "345"] | array['\d', "a"] | [1, a, 2, a, a, 3, 4, 5] |
| "abc" | null::string | null |