From: Marcin Raczkowski Date: 2007-04-11T16:43:47+09:00 Subject: Re: Slow ruby regexes On Tuesday 10 April 2007 19:14, MenTaLguY wrote: > On Wed, 11 Apr 2007 03:56:28 +0900, "Robert Dober" wrote: > > The bad news is that the power of regexs will just not let you escape > > with bad design all the time, so knowing a lot about regexes is a > > necessary thing to use them well. > > No, the bad news is that the bad design of most "regex" implementations > will not let you escape with using "regexes" as if they were true regular > expressions; knowing a lot about the implementation of the regex engine is > a necessary thing to use them well. > > > But you are right of course that Ruby's current Regex implementation > > is not state of the art, useful, very useful nevertheless. > > NFAs were state-of-the-art in the 1960s. Backreferences are nice, but in > other respects we've actually regressed since then. > > I'm not suggesting we abandon backreferences and so forth (which are useful > sometimes), but rather that NFAs should be used for evaluating the majority > of "regexes" which don't use non-regular features. > > -mental Well topic is rather interesting, i'll try to check it soon, and i'll try to write ruby interface for c library that author of article reference, i was looking for good case to test including c into ruby. I'm not promising anything tho :) regexps are great tool for text processing, but serious log analyzers (like one my company use) are written in c and base on lots of low-level string manipulation, raw binary access to DB et cecera, not to mention that ruby is much much slower then c anyway. Greets Marcin Raczkowski