I have a string that comes in this format
Transaction 'pqr_111_xyz_222(Aaaa Bbbb Cccc - 3333)' failed due to connection error
I need to extract the text between ‘ and (.
pqr_111_xyz_222 in this example.
The following query returns ‘pqr_111_xyz_222(
select regexp_substr('Transaction ''pqr_111_xyz_222(Aaaa Bbbb Cccc - 3333)'' failed due to connection error', '''.+\(') from dual;
How do I modify the regex (or use any other technique that can included within this single query) so that the markers ‘ and ( are excluded and I get just pqr_111_xyz_222 ?
You could use
REGEXP_REPLACEinstead: