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.
In reply to Re: regex help
by kyle
in thread regex help
by rsiedl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |