in reply to Re: Arbitrary number of captures in a regular expression
in thread Arbitrary number of captures in a regular expression

I agree on the two-step approach (at least for now 1), but I'd reverse the specificity of the regexes: I'd first do the validation using a specific regex and in a second phase split out the data you want from the capture in the first, which might be using a simpler regex because you validated the data already:
while (<DATA>) { my ($params) = /^foo ((?:m \d+ *)*) bar$/; my @nums = $params=~ /\d+/g; print "$params -> (@nums)\n"; } __DATA__ foo m 1 m 2 m 3 m 4 bar foo m 2 m 4 m 7 bar foo m 1 bar

1 Looking at demerphq's slides on his work on extended regexes in Perl 5.10, it might become possible to have a simpler, single step solution in the near future. See %-.

But maybe I'm just dreaming.