Making regex suck less

Bengt Richter bokr at oz.net
Mon Sep 2 15:30:46 EDT 2002


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

>In article <3d725881.345921 at news.t-online.de>, Gerson Kurz wrote:
>> in the match or find function. So basically, couldn't one come up with
>> a *human readable* syntax for re, and compile that instead? Python
>
>Maybe Ka-Ping Yee's rxb?  http://web.lfw.org/python/rxb15.py
>
>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.)
>
I agree about new syntax, but I wouldn't mind having a re.help(regexp) function
for interactive use that would just explain in 'English' what the regexp expression
stands for. It would be a nice easy double check on whether I wrote what I meant,
and helpful for understanding someone else's magic. It shouldn't be that hard to do.

Regards,
Bengt Richter



More information about the Python-list mailing list