I am running below queries:-
But in both cases the single quote is missing in the last pair, can somebody help me fix the regex and replacement rules?
EDIT: Never mind, got the solution.
Code:
SQL> select regexp_replace('AB,CD','(..),',q'['\1',]') from dual;
'AB',CD
SQL>select regexp_replace('AB,CD,DE','(..),',q'['\1',]') from dual;
'AB','CD',DE
EDIT: Never mind, got the solution.