s/(\s*'[^']*?')//g;
I'm not sure why you enclose the pattern in parentheses as I don't think a capture is required. Also, you don't need the non-greedy quantifier when using negated character classes, that's the whole point of using them as it means you can avoid the commonly seen .*? pattern.
I hope this is of interest.
Cheers,
JohnGG
In reply to Re^2: strip text from a string
by johngg
in thread strip text from a string
by KalaMonkey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |