Hello,
Here's the simple query to illustrate the question:
SELECT regexp_substr('ABC|2222|454545|101010|DEFG' , '[^|]+', 1, 3) str
FROM dual
/
This works fine and brings the correct result - 454545. But if I remove the second value, for example then the result is wrong - 101010:
SELECT regexp_substr('ABC||454545|101010|DEFG' , '[^|]+', 1, 3) str
FROM dual
/
The idea is to get the digit only at 3rd position separated by pipe. Or digit only after the second pipe. The output should always be 454545.
And I'd appreciate a brief explanation why it skips. Could Oracle do better in general?
Thank you very much to all.