0

need regexp_substr for finding a string value between a string and a pipe

Example 1

'blah,blah...|text=1234|nmbnxcm'

Result 1:

1234

Example 2

'test,test...|text=4321|testing'

Result 2

4321
Jeff Holt
  • 2,940
  • 3
  • 22
  • 29
dreambigcoder
  • 1,859
  • 4
  • 22
  • 32
  • I'm pretty sure you'll get what you want [here](https://stackoverflow.com/questions/7758859/how-to-extract-group-from-regular-expression-in-oracle). – Jeff Holt Jul 18 '17 at 14:57

1 Answers1

2

If this doesn't help, then please try this, assuming there is only one occurrence of what you want from the source string.

select to_number(regexp_substr('blah,blah...|text=1234|nmbnxcm', '|text=([0-9]+)|', 1, 1, null, 1))
from dual;

The to_number wouldn't be required but is a bit more intentional w.r.t. the given RE.

Jeff Holt
  • 2,940
  • 3
  • 22
  • 29