Take substring of value returned from REGEXP_SUBSTR
612702Sep 15 2011 — edited Sep 15 2011I 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....