带有通配符的 patindex 和 instr 函数的 oracle 等效项
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2769350/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
oracle equivalent of patindex and instr function with wild card characters
提问by Hyman
is there an oracle equivalent of patindex
? from my search, the only function that is close to patindex
is oracle's instr
function but it does not support wild card.
是否有一个 oracle 等价物patindex
?从我的搜索来看,唯一接近patindex
的instr
功能是oracle的功能,但它不支持通配符。
what is the oracle equivalent of the following query?
以下查询的 oracle 等价物是什么?
select patindex('%[^0]%','00194505022')
edit: i found out regexp_instr
have the similar function as patindex
.
编辑:我发现regexp_instr
与patindex
.
回答by Gary Myers
There's regexp_instr that uses standard regular expression syntax for pattern matching.
regexp_instr 使用标准正则表达式语法进行模式匹配。
select regexp_instr('00194505022','[^0].*') from dual;