in reply to What's wrong with this regex
Since you have written only two pairs of (capturing) parentheses, you only get two match variables. A quantified capture stores only the string of the last match.
So either make the outer parenthesis capture, and use split to extract the numbers from $1, or write out four pairs of capturing parenthesis.
Note that this is more convenient in Perl 6: a quantified capture records a list of all matches.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: What's wrong with this regex
by bgu (Novice) on Mar 01, 2012 at 15:32 UTC | |
by moritz (Cardinal) on Mar 01, 2012 at 15:54 UTC | |
by toolic (Bishop) on Mar 01, 2012 at 15:39 UTC | |
by Riales (Hermit) on Mar 01, 2012 at 15:46 UTC |