[issue41555] re.sub replaces twice

Ma Lin report at bugs.python.org
Fri Aug 14 22:37:39 EDT 2020


Ma Lin <malincns at 163.com> added the comment:

The re.sub() doc said:
Changed in version 3.7: Empty matches for the pattern are replaced when adjacent to a previous non-empty match.

IMO 3.7+ behavior is more reasonable, and it fixed a bug, see issue25054.

----------
nosy: +malin

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41555>
_______________________________________


More information about the Python-bugs-list mailing list