This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author joncle
Recipients jmfauth, joncle
Date 2010-03-20.19:53:04
SpamBayes Score 8.085539e-05
Marked as misclassified No
Message-id <1269114787.17.0.973033053212.issue8185@psf.upfronthosting.co.za>
In-reply-to
Content
Seems consistent to me:

.match, .search and .finditer return a MatchObject whose .group() return the *entire matched string*. If you use .group(1) you'll get similar results to .findall() which returns a list of (possibly of tuples) of the captured groupings.

This is the findall equivalent (using a non-capturing group):

>>> re.findall('a(?:b)?', 'ab')
['ab']
History
Date User Action Args
2010-03-20 19:53:07jonclesetrecipients: + joncle, jmfauth
2010-03-20 19:53:07jonclesetmessageid: <1269114787.17.0.973033053212.issue8185@psf.upfronthosting.co.za>
2010-03-20 19:53:05jonclelinkissue8185 messages
2010-03-20 19:53:05jonclecreate