需要 regexp_substr 来查找字符串和管道之间的字符串值
示例 1
'blah,blah...|text=1234|nmbnxcm'
结果 1:
1234
示例 2
'test,test...|text=4321|testing'
结果 2
4321
如果这没有帮助,那么请尝试此操作,假设源字符串中只出现了一次您想要的内容。
select to_number(regexp_substr('blah,blah...|text=1234|nmbnxcm', '|text=([0-9]+)|', 1, 1, null, 1))
from dual;
to_number 不是必需的,但对于给定的 RE 来说更有意。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句