@LAST_MATCH_END @+ ... You can use $#+ to determine how many subgroups were in the last successful match. ... @LAST_MATCH_START @- ... One can use "$#-" to find the last matched subgroup in the last successful match. Contrast with $#+, the number of subgroups in the regular expression. #### pl@nereida:~/Lperltesting$ cat abigail1.pl #!/usr/bin/perl local $" = ", "; "a" =~ /(a)|(b)/; print "\@- = (@-)\t length of \@- = ".((scalar @-)."\t last - index = $#-\n"); print "\@+ = (@+)\t length of \@+ = ".((scalar @+)."\t last + index = $#+\n") #### pl@nereida:~/Lperltesting$ perl5.10.1 ./abigail1.pl @- = (0, 0) length of @- = 2 last - index = 1 @+ = (1, 1, ) length of @+ = 3 last + index = 2 pl@nereida:~/Lperltesting$ perl5.8.8 ./abigail1.pl @- = (0, 0) length of @- = 2 last - index = 1 @+ = (1, 1, ) length of @+ = 3 last + index = 2