The problem is that the repeated capturing overwrites the "inner" capture group so you won't be able to get more than one result from something like /(foo)*/g.
How much of the input do you control? Would it be feasible to just match any letters between %...% ?
my @matches = ($data =~ m/(?:%(\w+)%)/g );
In reply to Re: Trouble capturing multiple groupings in regex
by Corion
in thread Trouble capturing multiple groupings in regex
by reverendphil
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |