Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

oracle equivalent of patindex and instr function with wild card characters

Tags:

oracle

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.

what is the oracle equivalent of the following query?

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

edit: i found out regexp_instr have the similar function as patindex.

like image 636
Jack Avatar asked May 04 '10 22:05

Jack


1 Answers

There's regexp_instr that uses standard regular expression syntax for pattern matching.

select regexp_instr('00194505022','[^0].*') from dual;
like image 165
Gary Myers Avatar answered Sep 20 '22 11:09

Gary Myers