'abcdef' =~ /b(.)(.)./ and print "end of entire match ", $+[0], " end of first group ",$+[1], " end of second group ", $+[2], "\n"; #### end of entire match 5 end of first group 3 end of second group 4