in reply to Re: Re: Multiple matches of a regex
in thread Multiple matches of a regex
If I shall be picky, in your question you wanted the first match to return ['11', '30', undef] while in your reply you said ['11', '30'] is what you want. As I pointed out here you should consider the difference between $#+ and $#-. Also, unmatched groups would be '' with your code. Perhaps that's what you want, but it won't be fully analogous to using the $<DIGITS> variables. If done symbolically it sure will be analogous though, since you actually use the $<DIGITS> variables.no strict 'refs'; my @groups = map $$_, 1 .. $#+;
|
|---|