ORACLE:SQL REGEXP_SUBSTR that returns the column value after last backslash(/)
example: https://test/test/test/test/getTest/1234 expected value: 1234
ORACLE:SQL REGEXP_SUBSTR that returns the column value after last backslash(/)
example: https://test/test/test/test/getTest/1234 expected value: 1234
You don't need regular expressions for this. You can simply using substr
and instr
which are likely to perform faster:
select
substr(col, instr(col, '/', -1) + 1)
from t;
If you must use regexp_substr
(for some reason) then use:
select regexp_substr(col, '[^/]+$') from t;
If you need with REGEXP_SUBSTR also, then:
SELECT REGEXP_SUBSTR ('https://test/test/test/test/getTest/1234' , '[^/]+$' ) from dual