[Tutor] Using Regex to produce text

Jerry Hill malaclypse2 at gmail.com
Wed Apr 28 22:55:15 CEST 2010


On Wed, Apr 28, 2010 at 2:27 AM,  <mhw at doctors.net.uk> wrote:
> Is there an way of using the regex patterns to produce text, instead of matching it?

There have been some previous discussions about generating all of the
possible matches for a given regular expressions.  I believe these are
the first messages in a couple of recent threads on python-list:

http://mail.python.org/pipermail/python-list/2010-February/1235120.html
http://mail.python.org/pipermail/python-list/2010-March/1240605.html

There's at least one sample implementation using the pyparsing library here:
http://pyparsing.wikispaces.com/file/view/invRegex.py

This message appears to have another implementation, sent to the list
as attachments:
http://mail.python.org/pipermail/python-list/2010-April/1240687.html

I haven't tried any of them myself, but they may be useful to you if
you really need to go down this road.

-- 
Jerry


More information about the Tutor mailing list