classification
Title: sub-tle difference between pre and sre
Type: Stage:
Components: Regular Expressions Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: effbot Nosy List: effbot, serhiy.storchaka
Priority: normal Keywords:

Created on 2001-09-17 16:27 by effbot, last changed 2017-12-02 21:48 by serhiy.storchaka. This issue is now closed.

Messages (3)
msg6557 - (view) Author: Fredrik Lundh (effbot) * (Python committer) Date: 2001-09-17 16:27
as reported by Carlos Gaston Alvarez on 
comp.lang.python (verified in 2.1.1 and 2.2a3):

>>> import pre
>>> p = pre.compile("x*")
>>> p.sub("-", "abxd")
'-a-b-d-'

>>> import sre
>>> p = sre.compile("x*")
>>> p.sub("-", "abxd")
'-a-b--d-'

</F>
msg6558 - (view) Author: Fredrik Lundh (effbot) * (Python committer) Date: 2001-09-18 18:35
Logged In: YES 
user_id=38376

unlike PRE, SRE didn't ignore empty matches at
the last position.  you can never have too many
test cases...
msg307466 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-12-02 21:48
For history, this was fixed by 21009b9c6fc40b25fcb30ee60d6108f235733e40.
History
Date User Action Args
2017-12-02 21:48:39serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg307466
2001-09-17 16:27:45effbotcreate