in reply to Re^2: Regexes and backslashes
in thread Regexes and backslashes
OK, how about this one. It's a little bit klunky in its use of a conversion hash, but the hash can easily be expanded as needed.
>perl -wMstrict -le "$_ = 'Goodbye\; Good luck\, and thanks for all the fish!\n\n'; my %conv = ( ',' => ',', ';' => ';', n => qq{\n} ); print qq{[[$_]]}; s{ \\([,;n]) }{$conv{$1}}xmsg; print qq{[[$_]]};; " [[Goodbye\; Good luck\, and thanks for all the fish!\n\n]] [[Goodbye; Good luck, and thanks for all the fish! ]]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Regexes and backslashes
by oko1 (Deacon) on Feb 16, 2011 at 08:24 UTC | |
by wind (Priest) on Feb 16, 2011 at 08:44 UTC |