in reply to Pattern Matching, left-to-right

I offer a simple solution. I suppose that there are backslashes in the original string that are not part of an escape sequence you want to transform, this won't work at least not this way.

s/(\\.)\\/$1@/g; s/\\F@/|/g; s/\\S@/^/g; s/\\T@/&/g; s/\\R@/-/g; s/\\E@/\\/g;

Replies are listed 'Best First'.
Re^2: Pattern Matching, left-to-right
by antirice (Priest) on Aug 20, 2004 at 21:33 UTC

    Don't know if it's legal but what about this situation?

    $msgu = "\\F\\\\F@";

    antirice    
    The first rule of Perl club is - use Perl
    The
    ith rule of Perl club is - follow rule i - 1 for i > 1