[Python-ideas] Re module repeat
Tim Lesher
tlesher at gmail.com
Mon Aug 1 03:42:51 CEST 2011
More information about the Python-ideas mailing list
Mon Aug 1 03:42:51 CEST 2011
- Previous message: [Python-ideas] Re module repeat
- Next message: [Python-ideas] Re module repeat
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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', 'tag.-3':'a'} > 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>
- Previous message: [Python-ideas] Re module repeat
- Next message: [Python-ideas] Re module repeat
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-ideas mailing list