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 to replace 'A-Z' or 'a-z' with '-'

9067f314-5c33-4b29-a7b8-1222ed558e9fJul 1 2015 — edited Jul 2 2015

Hi all,

Need help with the following

I have a column with the following data set:

Registration_key

02BAE421A279

29a4bf67-2b8e

9067f314-5c33

I need the rows to populate as

02---421-279 or 02- works as well. Basically need to replace all alphabetic characters with '-'

I tired the following without any results:

Case

When

UPPER(REGISTRATION_KEY) BETWEEN UPPER('%A%') and UPPER('%Z%')  then REGEXP_REPLACE(REGISTRATION_KEY, '[^a-zA-Z'']', '-')

Else ''

end

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 30 2015
Added on Jul 1 2015
5 comments
901 views