Ryan Westlund <rlwestl...@gmail.com> added the comment:
Sorry, I forgot the pydoc docs don't have as much information as the online docs. On Mon, Jun 22, 2020 at 1:54 PM Ezio Melotti <rep...@bugs.python.org> wrote: > > Ezio Melotti <ezio.melo...@gmail.com> added the comment: > > This behavior was changed in 3.7: "Empty matches for the pattern are > replaced only when not adjacent to a previous empty match, so sub('x*', > '-', 'abxd') returns '-a-b--d-'." [0] > > See also bpo-32308 and bpo-25054. > > > [0]: https://docs.python.org/3/library/re.html#re.sub > > ---------- > resolution: -> not a bug > stage: -> resolved > status: open -> closed > superseder: -> Replace empty matches adjacent to a previous non-empty > match in re.sub() > > _______________________________________ > Python tracker <rep...@bugs.python.org> > <https://bugs.python.org/issue41080> > _______________________________________ > ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue41080> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com