Help for this page

Select Code to Download


  1. or download this
     $str =~ $qr;
     print "$1, $2\n"; # or whatever
    
  2. or download this
    #!/usr/bin/perl -w
    
    ...
    # $+ text of last sucessful match
    # $^N similar, but of last rightmost closing paren
    # @+ array or end pos, $+[0] is whole, $#+ is last good
    
  3. or download this
    "abcdefghi" =~ /(b)(.(.))/;
    $` = (a) $& = (bcd) $' = (efghi) 
    ...
    $1 = (b) $2 = (cd) $3 = (d) $4 = () $5 = () $6 = () 
    @- = (1,1,2,3) 
    @+ = (4,2,4,4)