From: Kenneth McDonald Date: 2008-09-09T11:30:56+09:00 Subject: Re: Oniguruma question 'Cause I'm a Ruby newbie who's still learning this stuff :-) Ken On Sep 8, 2008, at 9:05 PM, Chad Perrin wrote: > On Mon, Sep 08, 2008 at 10:18:01PM +0900, Kenneth McDonald wrote: >> For those adventurous souls who are already using Oniguruma... >> >> With the following Oniguruma re: >> >> print "aabb".index(/.+?(?> print "\n" >> >> My reasoning tells me I should be getting 3, but I'm getting 0. >> Basically, the .+ should force the re 'cursor' past at least the >> first >> a; after that, the negative lookback should force it past the first >> b. >> Could someone explain where I'm misunderstanding? > > Not exactly an answer, but . . . > > Why use two print statements, the second just to add a newline > character, > rather than using puts? > > -- > Chad Perrin [ content licensed PDL: http://pdl.apotheon.org ] > Paul Graham: "Object-oriented programming offers a sustainable way to > write spaghetti code."