- or download this
@LAST_MATCH_END
@+
...
subgroup in the last successful match.
Contrast with $#+, the number of subgroups
in the regular expression.
- or download this
pl@nereida:~/Lperltesting$ cat abigail1.pl
#!/usr/bin/perl
...
"a" =~ /(a)|(b)/;
print "\@- = (@-)\t length of \@- = ".((scalar @-)."\t last - index =
+$#-\n");
print "\@+ = (@+)\t length of \@+ = ".((scalar @+)."\t last + index =
+$#+\n")
- or download this
pl@nereida:~/Lperltesting$ perl5.10.1 ./abigail1.pl
@- = (0, 0) length of @- = 2 last - index = 1
...
pl@nereida:~/Lperltesting$ perl5.8.8 ./abigail1.pl
@- = (0, 0) length of @- = 2 last - index = 1
@+ = (1, 1, ) length of @+ = 3 last + index = 2