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 - handle all special characters and non printable characters like normal characters

S-MaxJan 20 2016 — edited Jan 21 2016

Hi all,

I am new to regular expressions, but would like to use it for the simple "search & replace" function:

This is OK:

SELECT REGEXP_REPLACE('([*\/{$test])', 'test', 'aaa', 1, 0, 'i') regexp_replace FROM DUAL;

This does not work:

SELECT REGEXP_REPLACE('([*\/{$test])', '[', '?', 1, 0, 'i') regexp_replace FROM DUAL; => ORA-12726

How should be the pattern to support all possible replace requests?

It should working like the "Search & Replace" functionality from notepad or other programms.

Thanks

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 18 2016
Added on Jan 20 2016
7 comments
3,864 views