From: Chad Perrin Date: 2008-09-09T11:05:56+09:00 Subject: Re: Oniguruma question --C94crkcyjafcjHxo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 08, 2008 at 10:18:01PM +0900, Kenneth McDonald wrote: > For those adventurous souls who are already using Oniguruma... >=20 > With the following Oniguruma re: >=20 > print "aabb".index(/.+?(? print "\n" >=20 > My reasoning tells me I should be getting 3, but I'm getting 0. =20 > Basically, the .+ should force the re 'cursor' past at least the first = =20 > a; after that, the negative lookback should force it past the first b. = =20 > 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? --=20 Chad Perrin [ content licensed PDL: http://pdl.apotheon.org ] Paul Graham: "Object-oriented programming offers a sustainable way to write spaghetti code." --C94crkcyjafcjHxo Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkjF2cUACgkQ9mn/Pj01uKUP7QCfcKuc2AcjoXlVWmGtFZw8GhGj ku8An0uzf69hQ4aFmt3ktPkLNkFVo5Hd =eZzb -----END PGP SIGNATURE----- --C94crkcyjafcjHxo--