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!

Take substring of value returned from REGEXP_SUBSTR

612702Sep 15 2011 — edited Sep 15 2011
I havent used regular expressions really before and have been trying to do some reading up on how it works.

Im trying to parse a string to pull a specific value from it.

Using an example I found from Oracle I was able to find something that is very close to what i want to do, but includes the delimiting character and I cant seem to find a way to get rid of it.

For example

SELECT REGEXP_SUBSTR('COUNT:88,NUMBER:12345678,LICENSE:123456789', ':[^,]+',1,1) RESULT
FROM DUAL;

This returns :88

Altering it a bit

SELECT REGEXP_SUBSTR('COUNT:88,NUMBER:12345678,LICENSE:123456789', ':[^,]+',1,2) RESULT
FROM DUAL;

I get a return of: :12345678

Which is basically what i want, i want to be able to extract the values between the ':' and the ','

The values can vary in length so I ruled out using substr function.

Would anyone know how i can just get the numeric output without the extra ':' in front?

Much appreciated....
This post has been answered by AdamMartin on Sep 15 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 13 2011
Added on Sep 15 2011
7 comments
998 views