【发布时间】:2020-03-04 04:22:32
【问题描述】:
我有一个字符串,我想捕获 "\Close_Out" 之前的所有内容:
字符串:\fileshare\R and G\123456\Close_Out\Warranty Letter.pdf
我想出的唯一解决方案是使用正向前瞻,当我在 https://regex101.com/ 上测试它时有效
(.*)(?=\\Close_Out)
但现在我需要在 Oracle SQL 语句中使用它:
select REGEXP_SUBSTR('\\fileshare\R and G\123456\Close_Out\Warranty Letter.pdf', '(.*)(?=\\Close_Out)') from dual
它不起作用,因为(我认为)不支持向前看。有人可以协助使用可在 sql 中使用的替代表达式
【问题讨论】: