This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients serhiy.storchaka, zzzeek
Date 2018-03-05.16:09:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1520266175.33.0.467229070634.issue32998@psf.upfronthosting.co.za>
In-reply-to
Content
This is intentional change.

Prior to 3.7 re.sub() didn't replace empty matches adjacent to a previous non-empty match. In 3.7 it does. Together with other changes this made all four functions that search multiple matches of the pattern (re.findall(), re.finditer(), re.split() and re.sub()) consistent.

In your example the pattern matches not only from " COLLATE" to the end of input string, but an empty string at the end of input string. If you do not want matching an empty string, just remove the '?' qualifier.
History
Date User Action Args
2018-03-05 16:09:35serhiy.storchakasetrecipients: + serhiy.storchaka, zzzeek
2018-03-05 16:09:35serhiy.storchakasetmessageid: <1520266175.33.0.467229070634.issue32998@psf.upfronthosting.co.za>
2018-03-05 16:09:35serhiy.storchakalinkissue32998 messages
2018-03-05 16:09:35serhiy.storchakacreate