Capturing repeating group matches in regular expressions

Michael Hudson mwh at python.net
Wed Aug 11 07:04:28 EDT 2004


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

And there's always the "use a real parser" option :-)

Cheers,
mwh

-- 
  All obscurity will buy you is time enough to contract venereal
  diseases.                                  -- Tim Peters, python-dev



More information about the Python-list mailing list