On Wed, Apr 28, 2010 at 2:27 AM, <m...@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 _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor