I am using REGEXP_SUBSTR in Oracle 11g and I am having difficulty trying to extract the following strings.
My query is:
SELECT regexp_substr('CN=aTIGERAdmin-Admin, CN=D0902498, CN=ea90045052, CN=aTIGERCall-Admin,', '[^CN=]*\,', 1, rownum) line
FROM dual
CONNECT BY LEVEL <= length('CN=aTIGERAdmin-Admin, CN=D0902498, CN=ea90045052, CN=aTIGERCall-Admin,') -
length(REPLACE('CN=aTIGERAdmin-Admin, CN=D0902498, CN=ea90045052, CN=aTIGERCall-Admin,', ',', ''))
From this query, I am having issues trying to match on exact string 'CN=' as from this query, I need the output to appear as follows:
CN=aTIGERAdmin-Admin,
CN=D0902498,
CN=ea90045052,
CN=aTIGERCall-Admin,
And in this format, with the comma at the end.
The way I am doing it at the moment is chopping off the "CN=" but I actually require this part.