[Python-Dev] New regex syntax? (was: Some questions about maintenance of the regular expression code.)

Brett Cannon bac@OCF.Berkeley.EDU
Wed, 26 Feb 2003 12:39:41 -0800 (PST)


[Gary Herron]

> It stumped my for a while also, even though I've used them on
> occasion.

The '|' has always thrown me; always want it to bind more tightly.

> In general I find regular expressions mostly unreadable.

Ditto.

> Solutions for that problem would occupy a (probably long and hopefully
> different) thread.
>

Is there enough interest to actually put the time and effort into
attempting to develop new regex syntax?  There is obviously always the
option to follow Perl 6's suggested new syntax.  We could also come up
with a more Pythonic solution.  I suspect this would be big enough to
require its own SIG or something.

Ping has a module at http://lfw.org/python/rxb15.py that creates regexes
patterns using a much more straight-forward syntax by using actual words
to represent things; there are functions like 'maybe', 'exactly', etc.
(don't know how powerful it is, though; he just showed it to me briefly
two weeks ago).

-Brett