in reply to Capturing brackets within a repeat group
The passage from perlre is:
The numbered variables ($1, $2, $3, etc.) and the related punctuation set ($+, $&, $`, $', and $^N) are all dynamically scoped until the end of the enclosing block or until the next successful match, whichever comes first.
So you can only get at the last captured repeated group from outside the regex this way: the earlier captures get overwritten when repeatedly matching the repeated sub-pattern to get an overall match.
&mdash Arien
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Capturing brackets within a repeat group
by BrowserUk (Patriarch) on Jan 11, 2003 at 03:51 UTC | |
by John M. Dlugosz (Monsignor) on Jan 11, 2003 at 06:15 UTC | |
by BrowserUk (Patriarch) on Jan 11, 2003 at 10:19 UTC | |
by John M. Dlugosz (Monsignor) on Jan 11, 2003 at 17:55 UTC |