Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:
It is correct and documented behavior. ".*" matches two substrings: the whole string "bc" and an empty string at the end of the string. See https://docs.python.org/3/library/re.html#re.sub and https://docs.python.org/3/whatsnew/3.7.html#changes-in-the-python-api. The behavior before 3.7 was incorrect. ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue39687> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com