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 C. Y. Hollander
Recipients C. Y. Hollander, docs@python
Date 2018-04-26.19:08:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1524769737.79.0.682650639539.issue33368@psf.upfronthosting.co.za>
In-reply-to
Content
The documentation states that match.end([group]) returns "the ind[ex] of the... end of the substring matched by group". In fact, it returns [said index] + 1, as demonstrated by the example below:

s = 'example'
sre = re.search('le', s)
s[sre.end()]

Incidentally, I don't see the logic of this behaviour, but in any case it should be correctly documented.
History
Date User Action Args
2018-04-26 19:08:57C. Y. Hollandersetrecipients: + C. Y. Hollander, docs@python
2018-04-26 19:08:57C. Y. Hollandersetmessageid: <1524769737.79.0.682650639539.issue33368@psf.upfronthosting.co.za>
2018-04-26 19:08:57C. Y. Hollanderlinkissue33368 messages
2018-04-26 19:08:57C. Y. Hollandercreate