regexpExtract
This section contains reference documentation for the regexpExtract function.
Last updated
Was this helpful?
This section contains reference documentation for the regexpExtract function.
Last updated
Was this helpful?
Was this helpful?
Extracts values that match the provided regular expression
regexpExtract(value, regexp)
regexpExtract(value, regexp, group)
regexpExtract(value, regexp, group, defaultValue)
select regexpExtract('foo', '.*') AS value
from ignoreMe
foo
select regexpExtract('foo123', '[0-9]+') AS value
from ignoreMe
123
select regexpExtract('foo123', '[^0-9]+') AS value
from ignoreMe
foo
select regexpExtract('foo bar baz', '(\w+) (\w+)', 0) AS value
from ignoreMe
foo bar
select regexpExtract('foo bar baz', '(\w+) (\w+)', 2) AS value
from ignoreMe
bar
select regexpExtract('foo123', 'bar', 0, 'defaultValue') AS value
from ignoreMe
defaultValue