The following example replaces the substring that matches the regular expression l[[: alpha:]]{4} with the string sound using REGEXP_REPLACE():
SQL> SQL> SELECT REGEXP_REPLACE('abcedfghijklumnoprstuvwxyzabcedfghijklumnoprstuvwxyzabcedfghijklumnoprstuvwxyz', 'l[[:alpha:]]{4}', 'sound') AS result 2 FROM dual; RESULT ------------------------------------------------------------------------------ abcedfghijksoundprstuvwxyzabcedfghijksoundprstuvwxyzabcedfghijksoundprstuvwxyz SQL>
18.4.REGEXP_REPLACE | ||||
18.4.1. | Regexp_Replace returns the source_string with every occurrence of the pattern_to_find replaced with the replace_string | |||
18.4.2. | Regext_Replace | |||
18.4.3. | The Backslash as an Escape Character | |||
18.4.4. | REGEXP_REPLACE(x, pattern [, replace_string [, start [, occurrence [, match_option]]]]) searches x for pattern and replace it with replace_string | |||
18.4.5. | Convert a name in the form 'first middle last' into the 'last, middle first' format |