- or download this
my $any_slash_or_at = qr{ [\\@] }x;
- or download this
s/(?<![\\\@])[\\\@]\@/\x11/g;
s/(?<![\\\@])[\\\@]\\/\x12/g;
- or download this
s/$slash_or_at__at/DC1/g;
s/$slash_or_at__slash/DC2/g;
- or download this
#!/usr/bin/env perl -l
...
print;
s/$escape_slash_or_at/$replace{$1}/g;
print;
- or download this
Testing your code:
\\\ \\@ \@\ \@@ @\\ @\@ @@\ @@@ \\ \@ @\ @@ \ @
...
Testing simultaneous replacements:
\\\ \\@ \@\ \@@ @\\ @\@ @@\ @@@ \\ \@ @\ @@ \ @
DC2\ DC2@ DC1\ DC1@ DC2\ DC2@ DC1\ DC1@ DC2 DC1 DC2 DC1 \ @