From: Ben Tilly Date: 2001-01-22T21:45:06+09:00 Subject: [ruby-talk:9713] Re: Regexp engine (was Re: 101 Misconceptions About Dynamic Languages) wrote: > > >>>>> "B" == Brian F Feldman writes: > >B> Henry Spencer's totally rewritten regex package which is now embedded in >Tcl >B> 8.3 is _THE_ one to choose. > > Do it have some incompatibilities with perl regexp ? > It used to. TCL tried to be compatible with the POSIX regular expression standard which is designed for DFA engines. There is essentially no compromise between the POSIX standard and Perl's ability to have a fine-grained switching between greedy and non-greedy. This is a significant difference and I can find no reference to it having changed. Additionally Tcl used to not support most of the standard RE features. This may have changed. > >B> It should be the fastest one out there now, >and >B> a nice license to boot. > > Do you have some benchmark for regexp ? > A Google search for "TCL 8.3" and "regexp" turned up: http://lists.bell-labs.com/pipermail/nsbd/2000q2/000001.html which is not very promising. Friedl is in the process of producing a new edition of Mastering Regular Expressions. He undoubtably has a good benchmark suite. Benchmarks are going to be misleading here. Judging from what was said in MRE edition 1, the TCL engine is a DFA at heart. However there is a quadratic support for capturing subexpressions. That means that in the very common case of capturing subexpressions, on average the TCL engine will be drastically slower than an NFA. However there is *NO* RE which is going to be disasterously slow. But backreferences won't be supported or supportable. Cheers, Ben _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com