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 with all keyboard characters

Rob JonesJul 12 2013 — edited Jul 12 2013

Hi,

Using Oracle 11gr2. I'm trying to develop an expression which replaces all characters not found on the keyboard with the number 2. However, the expression I've developed doesn't seem to handle all characters. When testing it out, some characters are replaced successfully, while others aren't. For example, if I remove the () from the regexp_replace list, I should expect the query's result to show 22, but it doesn't. Similar results happened for other characters. Here's my query. Any suggestions would be appreciated.

select

regexp_replace('$#()/*%.,''&-~`:+!@^_=|\;"<>?/[]{}', '[^A-Za-z0-9$#()/*%.,''&-~`:+!@^_=|\;"<>?/[]{}]', '2') as test

from dual

This post has been answered by chris227 on Jul 12 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 9 2013
Added on Jul 12 2013
4 comments
633 views