On Sat, Dec 19, 2020 at 11:01:52AM -0500, Stefan Monnier wrote: > > It's well known that perl's regexp is very powerful for its capability > > of text processing. So, which is more powerful, emacs or perl, in this > > scenario? > > Probably Snobol or Icon. Tcl ;-P While somewhat tongue-in-cheek, I have some (by now older) reference to back it [1]. The gist is that Tcl actually implements Thompson's clever strategy (NFA -> power set DFA, yadda, yadda), while the P* languages (Perl, Python, PHP, Ruby... to me, they are quite similar, all of them [2]) all seem to use backtracking implementations. They do have a more convenient (and strictly more powerful!) RE language, but they do pay the price in terms of the occassional exponential runaway [3]. Now to the tongue-in-cheek part: Tcl has evolved since [1] (which was around 2007) -- as have the other P*s. Among other things, I hear that they have overhauled their regexpery (which is something awe-inspiring: most projects, once they have a regexp engine in them, DON'T TOUCH IT. Too much black magic and forgotten lore in there :-) But Tcl folks are like that. Perhaps Tcl cas chosen the "convenience" path, and their regexp engine resembles more that of the P*s these days. Cheers [1] "Regular Expression Matching Can Be Simple And Fast (but is slow in Java, Perl, PHP, Python, Ruby, ...)" [2] But I do enjoy (a limited amount) of those bragging contests "My Python is better than your Perl, nyah, nyah". They tickle the hobby anthropoligist in me ;-) [3] This afforded me a job asignment a long, long time ago - t