[Python-ideas] Re module repeat

Tim Lesher tlesher at gmail.com
Mon Aug 1 03:42:51 CEST 2011

On Jul 31, 2011 8:57 PM, "Christopher King" <g.nius.ck at gmail.com> wrote:
> What would happen is if you do something like.
> match=re.search('^(?PP<tag>[a-z])*$', 'abc')
> Then the match.groupdict() would return
> {'tag.0':'a', 'tag.1':'b', 'tag.2':'c', 'tag.-1':'c', 'tag.-2':'b',
> notice the PP. This means that it will save all the times it matches.

If you want to return something that supports negative indexing, why not
return a list instead of an ad-hoc string representation?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20110731/d95ab13b/attachment.html>

More information about the Python-ideas mailing list