[issue37594] re does not honor matching trailing multiple periods

brent s. report at bugs.python.org
Sun Jul 14 17:31:19 EDT 2019


brent s. <brent.saner at gmail.com> added the comment:

Oh for pete's sake. I wish I could edit comments.

Eric-

To make it clear:

*****

VERSION: 2.7.16 (default, Mar 11 2019, 18:59:25) 
[GCC 8.2.1 20181127]
PATTERN: \.*$

BEFORE: a.b
WITHOUT: a.b
DUMMY: a.bX
AFTER: a.b.
RSTRIP: a.b
==
BEFORE: a.b.
WITHOUT: a.b
DUMMY: a.bX
AFTER: a.b.
RSTRIP: a.b
==
BEFORE: a.b..
WITHOUT: a.b
DUMMY: a.bX
AFTER: a.b.
RSTRIP: a.b
==
BEFORE: a.b...
WITHOUT: a.b
DUMMY: a.bX
AFTER: a.b.
RSTRIP: a.b
==

*****

VERSION: 3.7.3 (default, Jun 24 2019, 04:54:02) 
[GCC 9.1.0]
PATTERN: \.*$

BEFORE: a.b
WITHOUT: a.b
DUMMY: a.bX
AFTER: a.b.
RSTRIP: a.b
==
BEFORE: a.b.
WITHOUT: a.b
DUMMY: a.bXX
AFTER: a.b..
RSTRIP: a.b
==
BEFORE: a.b..
WITHOUT: a.b
DUMMY: a.bXX
AFTER: a.b..
RSTRIP: a.b
==
BEFORE: a.b...
WITHOUT: a.b
DUMMY: a.bXX
AFTER: a.b..
RSTRIP: a.b
==


Note the differences between versions for cases a.b., a.b.., and a.b... ("BEFORE: ..." lines). Compare their "AFTER" and "DUMMY" lines between python2 and python3.



Serhiy-

Apologies; I meant RFC1035; I typo'd that. But as shown above, the difference is pretty distinct (and inconsistent with GNU sed behaviour).

----------

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


More information about the Python-bugs-list mailing list