From: dblack@... Date: 2006-01-07T13:10:04+09:00 Subject: Re: Oniguruma lookbehind question Hi -- On Sat, 7 Jan 2006, Xavier Noria wrote: > On Jan 7, 2006, at 3:56, dblack@wobblini.net wrote: > >> # Now, do the same thing *or* \S+. This should, I think, >> # pick up the abc, def, and mno substrings too. >> >> re2 = /((?<=")[^"]+(?="))|(\S+)/ >> >> # But it doesn't; the part before the alternation never >> # matches, > > It shouldn't, since pattern-matching goes left-to-right \S will match the > quote before the first half of the regexp gets a chance, since it wants to > match the first character _after_ the quote. OK, I see. I was somehow discounting the fact that the first " *itself* doesn't match the left-hand alternate. Thanks -- David -- David A. Black dblack@wobblini.net "Ruby for Rails", from Manning Publications, coming April 2006! http://www.manning.com/books/black