Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

REGEXP_REPLACE does not give expected result

antobayFeb 22 2021

Please help, am trying to remove all special characters from a string but REGEXP_REPLACE does not give me the result am expecting. I will be grateful for your help.
Many thanks
These are the strings that am trying to remove special characters from

SELECT REGEXP_REPLACE('FHU "WALMO" WALDEMAR WOŹNIAK', '[^0-9A-Za-z]', '') FROM dual;
SELECT REGEXP_REPLACE('NUR FÜR KUNDENDIENST!', '[^0-9A-Za-z]', '') FROM dual;
SELECT REGEXP_REPLACE('"DAR-GAZ" GAJOS DARIUSZ', '[^0-9A-Za-z]', '') FROM dual;

These are my results

FHUWALMOWALDEMARWOZNIAK
NURFRKUNDENDIENST
DARGAZGAJOSDARIUSZ

These are the results that am expecting (i.e. keeping the space between the names)

FHU WALMO WALDEMAR WOZNIAK
NUR FR KUNDENDIENST
DARGAZ GAJOS DARIUSZ
This post has been answered by mathguy on Feb 22 2021
Jump to Answer
Comments
Post Details
Added on Feb 22 2021
8 comments
859 views