[New-bugs-announce] [issue33368] Inaccuracy in https://docs.python.org/3/library/re.html#re.match.end
C. Y. Hollander
report at bugs.python.org
Thu Apr 26 15:08:57 EDT 2018
New submission from C. Y. Hollander <judah0 at gmail.com>:
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.
----------
assignee: docs at python
components: Documentation
messages: 315813
nosy: C. Y. Hollander, docs at python
priority: normal
severity: normal
status: open
title: Inaccuracy in https://docs.python.org/3/library/re.html#re.match.end
type: enhancement
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33368>
_______________________________________
More information about the New-bugs-announce
mailing list