I should have tested my code, I got confused and thought @- held the submatches themselves, not the indexes. So I actually meant $res{$&} = [ $1, $2, $3]; but got lazy :). And $res{$1} = [ $2, $3, $4 ] works without $& with the extra parentheses.
Your proposition has the benefit of not requiring to know the inner regex and its number of captures :)
In reply to Re^3: Behavior of /g when there are capture groups
by Eily
in thread Behavior of /g when there are capture groups
by ExReg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |