From: Robert Klemme Date: 2007-03-17T23:45:04+09:00 Subject: Re: A couple of questions from a Ruby neophyte On 17.03.2007 15:37, Phrogz wrote: > On Mar 10, 1:34 am, "gga" wrote: >> On 8 mar, 09:08, "planetthoughtful" > One question: >> Ruby1.8's regexp engine is less powerful than Perl's or Python's as it >> does not have backtracking, named groups or unicode (if you don't know >> what that is or care, ruby1.8's regexp are perfect for you already). > > If I understand the terminology correctly, the 1.8 regexp engine > doesn't support lookbehind assertions (positive or negative), but it > does support backtracking. Isn't backtracking what permits /.*bar/ to > match "foobar"? Without backtracking, .* would match "foobar", and > then the regexp would fail when it didn't find another "bar" after > "foobar". Yes. Basically NFA regexp engines have to do backtracking, DFA's don't. See "Mastering Regular Expressions" for details. Kind regards robert