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 martin.panter
Recipients Alcolo Alcolo, ezio.melotti, martin.panter, mrabarnett, r.david.murray, serhiy.storchaka
Date 2017-12-02.10:50:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The new “finditer” behaviour seems to contradict the documentation about excluding empty matches if they touch the start of another match.

>>> list(re.finditer(r"\b|:+", "a::bc"))
[<re.Match object; span=(0, 0), match=''>, <re.Match object; span=(1, 1), match=''>, <re.Match object; span=(1, 3), match='::'>, <re.Match object; span=(3, 3), match=''>, <re.Match object; span=(5, 5), match=''>]

An empty match at (1, 1) is included, despite it touching the beginning of the match at (1, 3). My best guess is that when an empty match is found, searching continues at the same position for the first non-empty match.
Date User Action Args
2017-12-02 10:50:48martin.pantersetrecipients: + martin.panter, ezio.melotti, mrabarnett, r.david.murray, serhiy.storchaka, Alcolo Alcolo
2017-12-02 10:50:48martin.pantersetmessageid: <>
2017-12-02 10:50:48martin.panterlinkissue25054 messages
2017-12-02 10:50:47martin.pantercreate