Help for this page

Select Code to Download


  1. or download this
         1 while s/pattern/length($`)/e;
    
  2. or download this
         1 while s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e;
    
  3. or download this
    s/^([^ ]+) +([^ ]+)/$2 $1/;   # swap first two words
    /(\w+)\s*=\s*\1/;             # match "foo = foo"
    ...
            $minutes = $2;
            $seconds = $3;
    }
    
  4. or download this
    $_ = <STDIN>;
    s/.*(some_string).*/$1/;
    
  5. or download this
    s/.*(some_string).*/$1/s;
    s/.*(some_string).*\n/$1/;
    ...
    
    chop; s/.*(some_string).*/$1/;
    /(some_string)/ && ($_ = $1);
    
  6. or download this
    $pattern =~ s/(\W)/\\$1/g;
    
  7. or download this
    /$unquoted\Q$quoted\E$unquoted/
    
  8. or download this
    /^fee|fie|foe$/
    
  9. or download this
    /^(fee|fie|foe)$/