Hello Experts,
I have this simple requirement:
input: 'one/two/three/four/five'
output: 'four/five' on providing 2
input: 'one/two/three/four/five'
output: 'five' on providing 1
Basically I will input the no of words that I want and I will have to extract them from the mail string. I have the below perfectly working code.
WITH inputs(val) AS
(SELECT 'one/two/three/four/five' FROM dual)
SELECT Ltrim(Substr(val, Instr(val, '/', -1, :user_input)), '/') AS val
FROM inputs;
But I was just wondering if there is any regular expression solution that involves one pass.
For eg: regexp_substr(val,'pattern',whatever_is_necessary)
Eager to learn if there is one. Thanks in advance.
Oracle Version: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
Regards,
Ranagal