my $str = 'Hulk hate classless system with means of manufacturing given to working class! Hulk crush puny Marxists!'; if ($str =~ /Hulk hate \w+/) { print "\$-[0] <$-[0]> \$+[0] <$+[0]>\n"; my $word = substr $str, $-[0] + 10, $+[0] - $-[0] + 10; print "word <$word>\n"; } __END__ $-[0] <0> $+[0] <19> word