The REGEXP_REPLACE is an Oracle PLSQL function that works almost in the same way of the REPLACE function but extends its functionalities by using regular expression pattern.
In the following example I show you how to replace in a given string each occurrence of two or more spaces with a single space.
SQL> SELECT REGEXP_REPLACE('Too Many Spaces','( ){2,}', ' ') REPLACED_STRING FROM DUAL;
REPLACED_STRING
----------------
Too Many Spaces
