in reply to Trouble capturing multiple groupings in regex

The following works for me:

my $input1 ="<span color=\"#231f20\" textOverprint=\"false\">%PN1%</sp +an>"; my $input2 ="<span color=\"#231f20\" textOverprint=\"false\">%DIMMM%%D +IMINCH%</span>"; my @matches = $input1 =~ m/%([^%]+)%/g ; print @matches,"\n"; @matches = $input2 =~ m/%([^%]+)%/g ; print @matches[0],"___",@matches[1],"\n";

HTH, Rata