regexp_replace(string, pattern, replacement)
Query
presto:default> SELECT regexp_replace('1a 2b 3c 6f', '(\d+)([abc]) ', 'aa$2 ')
as expression;
Result
expression ---------------- aaa aab aac 6f (1 row)
Replace the instance of the string matched for the expression with the pattern and replacement string aa.
apache_presto_sql_functions.htm
Advertisements