In Oracle/PLSQL, the instr
function returns the location of a substring in a string.
If the substring is not found, then instr
will return 0.
I want to search multiple substrings in a string and return the first non-zero value. This can be acheived using regexp_instr
, but I'd like a non-regexp_
solution.
Example:
regexp_instr('500 Oracle Parkway, Redwood Shores, CA','(Apple|Park|Shores)')
should return 12 (the location of 'Park').