REGEXP REPLACE

From Oracle FAQ

Jump to: navigation, search

REGEXP_REPLACE is an SQL function that can do string replacements based on a regular expression.

Examples

Replace all letter O's with the number 0:

SELECT REGEXP_REPLACE(col1, 'O', '0') FROM tab1;

Remove all special (unprintable) characters from a string:

SELECT REGEXP_REPLACE(col1, '[:cntrl:]', ' ') FROM tab1;
Personal tools