How to search a string in reverse order using REGEXP_INSTR
BurasamiSep 30 2010 — edited Sep 30 2010Hi All,
I have SQL query in which i wants to get the first occurrence position from end of the string
eg:
String:NBANK-ASD-00-1001-525-1002
Condition: position of character '-' from last. (note: character may also be '-' or '/')
output: 1002
for above condition i have return following query
SELECT SUBSTR('NBANK-ASD-00-1001-525-1002',REGEXP_INSTR('NBANK-ASD-00-1001-525-1002','[^-/]',1),LENGTH('NBANK-ASD-00-1001-525-1002')) FROM dual;
but i am getting following result
NBANK-ASD-00-1001-525-1002
means that the expression returns 0..
pls help me to resolve this.