my $string = 'yourregex here'; while($string =~ m/\(\?\<([a-zA-Z0-9]+)\>/g) { print $1, "\n"; }