Making regex suck less

Gerson Kurz moc.q-dnan-p at p-nand-q.com
Mon Sep 2 07:02:23 CEST 2002


On Sun, 01 Sep 2002 21:07:24 -0000, "A.M. Kuchling" <amk at amk.ca>
wrote:

>The problem with a new syntax is that no one else would be using it, so
>you'd still need to learn the existing syntax for use with grep, vi, Perl,
>&c.  (It wouldn't surprise me if Perl 6's revised regexes run into this very
>difficulty and don't gain much adoption.)

A tounge-in-cheek-answer: I don't use grep, I use python. I don't use
vi, I use python. I don't use perl, I use python :) 

Seriously, my thinking was, the re.compile function is there to
compile an expression to a binary representation for optimized
searching. So maybe, a "clean syntax" -> "ugly re syntax" compiler
would be good? 

Besides, you could use the output ("ugly re syntax") in grep, vi, perl
if you really so intended. 





More information about the Python-list mailing list