【发布时间】:2015-01-16 22:12:14
【问题描述】:
我在使用正则表达式时遇到问题
select REGEXP_REPLACE(declinereasondesc, '(.+)(£)(\d+)', '\1\3 (GBP)') as r from DECLINEREASON t
它与后面的行不匹配
Too expensive : By less than £100
Too expensive : By more than £200
预期结果
Too expensive : By less than 100 (GBP)
Too expensive : By more than 200 (GBP)
编辑:
非信徒截图
【问题讨论】:
-
你得到的输出是什么?你的正则表达式适合我
-
@arunb2w 它与行不匹配,所以没有任何变化 (
Too expensive : By less than £100) -
@vks 我知道regex101.com/r/dZ1vT6/10#pcre 在 oracle 中不起作用。
-
@LIUFA - 在这里工作正常 select REGEXP_REPLACE('太贵了:不到 100 英镑', '(.+)(£)(\d+)', '\1 \3 (GBP)') as r from dual; 我认为你的源字符串不是你所期望的
标签: regex oracle regexp-replace