in reply to Re: efficient char escape sequence substitution
in thread efficient char escape sequence substitution
In comp.lang.perl.misc I recently offered this solution.
s/(\\[^"\$\@]+)/qq("$1")/eeg;
Note that's not 100% infalible but AFAIK it's not a security problem and copes with all reasonable strings. It does have the interesting side effect of stripping \$ \" and \@ - but those have no buisness being in most of the sort of strings you'll encounter.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: efficient char escape sequence substitution
by Roy Johnson (Monsignor) on May 28, 2005 at 21:42 UTC | |
by nobull (Friar) on May 28, 2005 at 22:18 UTC |