I need help designing a Perl regular expression to match the string inside single quotes wherein escaped single quotes may be present.
For instance, the input text:
'SELECT * FROM TABLE WHERE COLUMN = \'text\''
Would match everything inside the outer single quotes, including the escaped quotes around the column text. I.e.:
SELECT * FROM TABLE WHERE COLUMN = \'text\'
I tried this:
/\s*'([^'|[^\\']]*)'\s*/
But that matching group failed to match anything at all. Any help would be appreciated.