- or download this
$str =~ $qr;
print "$1, $2\n"; # or whatever
- 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
- 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)