in reply to Re^2: Regexes and backslashes
in thread Regexes and backslashes
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
|
|---|