Would you like a Snobol pattern matcher? (Re: Making regex suck less)

Fernando Pereira pereira at cis.upenn.edu
Tue Sep 3 20:09:33 EDT 2002


On 9/3/02 2:13 PM, in article al30tq$aud$1 at solaris.cc.vt.edu, "Carl Banks"
<imbosol at vt.edu> wrote:
> I think there is a good reason to have a higher level syntax.  It
> serves a purpose heretofore unserved: that complex regular expressions
> no longer have to be unbearably unreadable.
The stronger version of this point is that at the moment there are no
methods for composing complex expressions from simpler ones that do not
involve manipulating strings, like building complex Python programs by
taking their pieces as strings, gluing them together and passing the result
to eval. Clearly a mess. For a good example of an alternative approach (in
Scheme) see

http://www.ai.mit.edu/people/shivers/sre.txt

The beauty of this kind of approach is that the expressive power of the host
language is fully available in constructing complex expressions.

-- F




More information about the Python-list mailing list