I'm relatively new to the regex with oracle and I was wondering how to split a text beetween two pipe. Here is the input string : 1||01|SOME_TEXT||02|OTHER_TEXT||
What I want is to retrieve 01|SOME_TEXT and 02|OTHER_TEXT
Here is what I tried :
`Select regexp_substr('1||01|SOME_TEXT||02|OTHER_TEXT||', '[^\|\|]', 1, Level) From Dual
Connect By regexp_substr('1||01|SOME_TEXT||02|OTHER_TEXT||', '[^\|\|]', 1, Level) Is Not Null`
I don't know how to filter only strings that are between double pipe AND maybe containing some single pipe.
Any help are welcome.
UPDATE
I have made it with the following pattern : (\w)+\|(\w)+(\|){2,2}+?
{n,n}where n is any number, like[A]{3,3}will matchAAA