in reply to regex help
Two small changes will help. The new regex line is:
my @matches = ( $term =~ /\"(.*?)\"\[MH\]/g );
The first change is to make the capture non-greedy (from (.+)? to (.*?)). The second change is to use the /g flag to collect all the matches, not just the first one. Have a look at perlre for all the gory details.
|
|---|