in reply to RE: Strip bad characters from a string
in thread Strip bad characters from a string

Try
s#(['"])#\\$1#g;
Result (using the same string that I used the first time):
\'foo\' is in single quotes, \"bar\" is in double quotes, and there are carriage returns between