From: Robert Dober Date: 2007-04-11T16:49:57+09:00 Subject: Re: Slow ruby regexes On 4/10/07, 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 > > > -- You see things; and you say Why? But I dream things that never were; and I say Why not? -- George Bernard Shaw