Pay particular attention to the way the \ (backslash) character interpolates into a single-quoted string, and how many of them you need to use to get a \\ double-backslash into the actual string (and printed).
>perl -wMstrict -le "$_ = 'Goodbye\; Good luck\, and thanks for all the fish!\\\\n\\\\n'; print; s{ \\(.) }{$1}xmsg; print; " Goodbye\; Good luck\, and thanks for all the fish!\\n\\n Goodbye; Good luck, and thanks for all the fish!\n\n
In reply to Re^3: Regexes and backslashes
by AnomalousMonk
in thread Regexes and backslashes
by oko1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |