New submission from C. Y. Hollander <jud...@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@python components: Documentation messages: 315813 nosy: C. Y. Hollander, docs@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 <rep...@bugs.python.org> <https://bugs.python.org/issue33368> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com