From: dblack@... Date: 2006-01-07T13:12:53+09:00 Subject: Re: Oniguruma lookbehind question Hi -- On Sat, 7 Jan 2006, Ross Bamford wrote: > On Sat, 07 Jan 2006 03:36:34 -0000, Ross Bamford > wrote: > >> If so, then I believe the problem is something to do with the fact that >> lookaround is atomic > > Argh, I meant 'if not'. I'm too tired now, I've spent too long perfecting > this quiz thing... > I was guessing it was dropping the match without the capture and so always > matching the alternate but that's not right. See Xavier's post. My mistake was, essentially, expecting the first " to "know" that it was supposed to match a zero-width condition governing the state one character later. Instead, of course, it asserts itself as a character in its own right; fails to match the first alternate; and does match the second. So [^\s"]+ is indeed probably the best thing. (Other than the appropriate real libraries, of course :-) David -- David A. Black dblack@wobblini.net "Ruby for Rails", from Manning Publications, coming April 2006! http://www.manning.com/books/black