Capturing repeating group matches in regular expressions

Erik Heneryd erik at heneryd.com
Thu Aug 12 06:57:51 EDT 2004


James Collier wrote:
> Michael Hudson [ mwh at python.net ] writes:
> 
> 
>>James Collier <james.collier at xtra.co.nz> writes:
>>
>>
>>>Is it possible to capture the results of repeating group matches in
>>>the python regular expression module?
>>
>>Not easily; there's a small dicussion on python-dev at the moment
>>about this.  Erik Heneryd hacked up something that might be useful:
>>
>>http://mail.python.org/pipermail/python-dev/attachments/20040810/a5e602ab/structmatch.py
>>

Should be added that this is a hack in the true sense of the word.  I 
wouldn't use it for anything other than for what it was written - 
experimenting.


Erik



More information about the Python-list mailing list