-- REGEXP_REPLACE(col, regexp, replace) SELECT REGEXP_REPLACE("stackoverflow", "(stack)(over)(flow)", '\\2 - \\1 - \\3') -- returns: over - stack - flow
Match_type arguments (regex modifiers available)
c – Case sensitive matching.
i – Case insensitive matching.
m – Multiple-line mode. Recognize line terminators within the string. The default behavior is to match line terminators only at the start and end of the string expression.
n – The
. character matches line terminators. The default is for
. matching to stop at the end of a line.
u – Unix-only line endings. Only the newline character is recognized as a line ending by the
$ match operators.