in reply to Re: Re: Re: Capturing everything after an optional character in a regex?
in thread Capturing everything after an optional character in a regex?
Are you suggesting that with /x it is somehow easier to determine which set of capturing parens loaded up the $1 and $2 special variables? Regular expression readability notwithstanding, I'm missing the point I guess.
The easiest solution I see to the counting problem is just to wrap the entire expression in an outter set of parens so that $1 captures both the right or the left side of the alternation.
But the point is moot I guess, since sauoq's answer seems to have solved the OP's problem in a more graceful way anyway.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Re: Capturing everything after an optional character in a regex?
by sauoq (Abbot) on Dec 05, 2003 at 02:46 UTC | |
|
Re^5: Capturing everything after an optional character in a regex?
by hardburn (Abbot) on Dec 05, 2003 at 14:41 UTC | |
by davido (Cardinal) on Dec 05, 2003 at 16:44 UTC | |
by hardburn (Abbot) on Dec 05, 2003 at 17:29 UTC |