Help for this page

Select Code to Download


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