You are viewing this site as a guest. You can still ask questions and help others! Join our Dev2Dev IT Community to receive your own blog, share your knowledge, and much more.

REGEXPR_SUBSTR returning too much data

5 replies [Last post]
Guest's picture
Guest

I'm trying to use REGEXPR_SUBSTR to return ONLY the data after the = sign in my string. For example, the string is T34XH5=170. I only want 170. I can't figure out how to strip out the =. I have tried several iterations. My current one is:

REGEXP_SUBSTR('T34XH5=170','=[^FINAL]+')
What I get is =170. I just need 170. ?

I've also tried:
REGEXP_SUBSTR('T34XH5=170','=[^ ]') and get the same result.

My SQL skills are pretty remedial so I'm kind of grasping here.
Thanks!
M

Guest's picture
Guest
Re: REGEXPR_SUBSTR returning too much data

Sorry.....that's REGEXP, not REGEXPR. See how remedial I am!!! :)

Guest's picture
Guest
Re: REGEXPR_SUBSTR returning too much data

Hiya,

Instr func should get you that, I do guess so....

Else give this a try,

SELECT SUBSTR('T34XH5=170.',8,12) FROM DUAL

Thanks,
RKO

Guest's picture
Guest
Re: REGEXPR_SUBSTR returning too much data

Regexp_Substr('T34XH5=170', '\d{3}')

Guest's picture
Guest
Re: REGEXPR_SUBSTR returning too much data

Regexp_Substr('T34XH5=170', '[^/=]+', 1, 2)

Guest's picture
Guest
Re: REGEXPR_SUBSTR returning too much data

Regexp_Substr('T34XH5=170', '=(.*)', 1, 1, 'i', 1)

Post new comment

CAPTCHA
The question below is to prevent automated spam submissions.
13 + 3 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.