regexp_replace

description

Syntax

`VARCHAR regexp_replace(VARCHAR str, VARCHAR pattern, VARCHAR repl)

Regular matching of STR strings, replacing the part hitting pattern with repl

example

  1. mysql> SELECT regexp_replace('a b c', " ", "-");
  2. +-----------------------------------+
  3. | regexp_replace('a b c', ' ', '-') |
  4. +-----------------------------------+
  5. A -b -c `124;
  6. +-----------------------------------+
  7. mysql> SELECT regexp_replace('a b c','(b)','<\\1>');
  8. +----------------------------------------+
  9. Replace ('a b c','(b)','<\1 >') regexp;
  10. +----------------------------------------+
  11. A <b >c {1244}
  12. +----------------------------------------+

keyword REGEXP_REPLACE,REGEXP,REPLACE