REGEXP_REPLACE function
Replaces all substrings of str that match the regular expression pattern with rep.
Note
CeloSQL uses Java regex patterns.
Syntax
REGEXP_REPLACE( str, pattern, rep, [ position ] )
Arguments
str: AVARCHARexpression to be matchedpattern: AVARCHARliteral with a regular expression patternrep: AVARCHARexpression to replace all matched substrings.position: Optional. The number of characters from the first to start matching.
Returns
A VARCHAR.
Examples
> SELECT regexp_replace('VEND - 1234567 WILLY WONKA', '(\d+)', '89');
'VEND - 89 WILLY WONKA'
> SELECT regexp_replace('hello world', 'goodbye.*', 'hello');
'hello world'