Skip to content

Latest commit

 

History

History
72 lines (54 loc) · 1.06 KB

regexpextract.md

File metadata and controls

72 lines (54 loc) · 1.06 KB
description
This section contains reference documentation for the regexpExtract function.

regexpExtract

Extracts values that match the provided regular expression

Signature

regexpExtract(value, regexp)

regexpExtract(value, regexp, group)

regexpExtract(value, regexp, group, defaultValue)

Usage Examples

select regexpExtract('foo', '.*') AS value
from ignoreMe
value
foo
select regexpExtract('foo123', '[0-9]+') AS value
from ignoreMe
value
123
select regexpExtract('foo123', '[^0-9]+') AS value
from ignoreMe
value
foo
select regexpExtract('foo bar baz', '(\w+) (\w+)', 0) AS value
from ignoreMe
value
foo bar
select regexpExtract('foo bar baz', '(\w+) (\w+)', 2) AS value
from ignoreMe
value
bar
select regexpExtract('foo123', 'bar', 0, 'defaultValue') AS value
from ignoreMe
value
defaultValue