[issue41555] re.sub replaces twice

2020-09-05 Thread S. Zhang
S. Zhang added the comment: Thanks. On Mon, Aug 17, 2020 at 7:40 PM Pablo Galindo Salgado < rep...@bugs.python.org> wrote: > > Change by Pablo Galindo Salgado : > > > -- > resolution: -> not a bug > stage: ->

[issue41555] re.sub replaces twice

2020-08-15 Thread S. Zhang
S. Zhang added the comment: Okay. Thanks. On Sat, Aug 15, 2020 at 9:07 AM Ma Lin wrote: > > Ma Lin added the comment: > > There can be at most one empty match at a position. IIRC, Perl's regex > engine has very similar behavior. > If don't want empty ma

[issue41555] re.sub replaces twice

2020-08-15 Thread S. Zhang
S. Zhang added the comment: Thanks. But if talking about empty matches, there would be endless empty matches at the end in such cases. So in my opinion, [^\.]*$ should match txt plus the empty match because the greedy rule applies here. On Fri, Aug 14, 2020 at 10:37 PM Ma Lin wrote

[issue41555] re.sub replaces twice

2020-08-14 Thread S. Zhang
New submission from S. Zhang : The following command produced "name.tsvtsv" with version 3.7.1 and 3.8.5 instead of the expected "name.tsv" from version 2.7.5, 3.5.6, and 3.6.7. Changing * to + produced expected "name.tsv". python -c 'import re; v="name.