dreambigcoder
dreambigcoder

Reputation: 1907

regexp_substr to get String between a string value and pipe

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

Upvotes: 0

Views: 1294

Answers (1)

Jeff Holt
Jeff Holt

Reputation: 3190

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.

Upvotes: 2

Related Questions