in reply to Re: Capturing everything after an optional character in a regex?
in thread Capturing everything after an optional character in a regex?
m/X(\S+)|((?<!X)\S+)/
Or here's a way without negative lookbehind:
m/X(\S+)|([^X]\S*)/
They're not functionally identical, but should both accomplish what you've described.
Of course there is the issue now of counting capturing parens.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Capturing everything after an optional character in a regex?
by Anonymous Monk on Dec 04, 2003 at 06:58 UTC | |
|
Re: Re: Re: Capturing everything after an optional character in a regex?
by hardburn (Abbot) on Dec 04, 2003 at 21:58 UTC | |
by davido (Cardinal) on Dec 04, 2003 at 23:09 UTC | |
by sauoq (Abbot) on Dec 05, 2003 at 02:46 UTC | |
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 |