我有一张桌子,是一些过程的描述。
我想使用regexp_substr
,但我不知道自己在做什么错。
我有一列内部具有某种结构的列,但是我所得到的所有内容都像“ something is here THISIS.WHATIWANTTOGETINRESULT some other text is here
”之类的文本,我想获取格式为“ *.*
”的字符串
我要使用的模式就像[spacebar][allnumbers and characters][.][allnumbers and characters][spacebar]
我现在正在使用类似的内容
regexp_substr( s1.message, '[ ][[:alnum:]]+.+[[:alnum:]][ ]')
但是它以某种方式剪切了我想要的字符串,但它在右侧保留了一个字符串,在左侧保留了一个字符串(示例-字符串为“ asd asd asd asd asd.asd asd asd asd asd”,并剪切了“ asd asd.asd asd” ')
我做错了什么?
答案 0 :(得分:1)
您可以尝试将REGEXP_SUBSTR
与捕获组一起使用:
SELECT
REGEXP_SUBSTR('something is here THISIS.WHATIWANTTOGETINRESULT something is here',
'something is here ([^.]+\.[^.]+) something is here', 1, 1, NULL, 1) AS output
FROM dual;
答案 1 :(得分:0)
好吧,我想我找到了解决方法
regexp_substr( s1.message,'\s\w+\.\w+' )
抱歉打扰