ok, this is untested, but i think something like this would work just nicely
for you:

@nums = $str =~ /@id='(\d+)'/g;

first element of @nums would be 1, 2nd would be 2 etc

if you're sure only the @ids have numbers in them, you could even suffice by
saying:

@nums = $str =~ /(\d+)/g;

your regexp looks quite a bit more complicated, so i might not fully
understand the problem you're trying to solve...

hth,
Jos Boumans

> my $str = "Account \@id='1' or \@id='2' or \@id='3' or \@id='4'";
>
> almost works, but only $1 and $2 contain captured values (3 and 4), how do
I
> capture the first two ids in the repetition? (In the real case the matched
> string will contain any number, from 1, of "id='\+'" expresses, and I want
> all of them!)


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to