From: Martin Kahlert Date: 2007-01-24T18:00:11+09:00 Subject: Re: Regular expression: Is this a bug or feature? On Tue, Jan 23, 2007 at 05:43:53PM +0900, George Ogata wrote: > I'm not sure why you think it might be a bug. The '|' operator just > binds very loosely, so you have to group the "a|b" in parens. Note > that in part 1, The bit that matches is the left side of the '|', > namely 'a' (no parens), so there are no captures. In part 2, the > right side ('b=(.)') matches, so there's 1 capture. In part 3, it > matches the whole thing ('(a|b)=(.)'), so there are 2 captures. > > Does this make sense? I always assumed 'a|b anything' means '(a|b) anything'. Thanks for this clarification! Regards Martin