in reply to Trouble capturing multiple groupings in regex

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 );