带有通配符的 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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 20:33:46  来源:igfitidea点击:

oracle equivalent of patindex and instr function with wild card characters

oracle

提问by Hyman

is there an oracle equivalent of patindex? from my search, the only function that is close to patindexis oracle's instrfunction but it does not support wild card.

是否有一个 oracle 等价物patindex?从我的搜索来看,唯一接近patindexinstr功能是oracle的功能,但它不支持通配符。

what is the oracle equivalent of the following query?

以下查询的 oracle 等价物是什么?

select patindex('%[^0]%','00194505022') 

edit: i found out regexp_instrhave the similar function as patindex.

编辑:我发现regexp_instrpatindex.

回答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;