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 Eugene.Morozov
Recipients Eugene.Morozov
Date 2011-02-20.22:28:09
SpamBayes Score 0.0021838674
Marked as misclassified No
Message-id <1298240893.99.0.359755744829.issue11262@psf.upfronthosting.co.za>
In-reply-to
Content
There's a peculiar and difficult to find bug in the re.sub method. Try following example:
>>> text = 'X'*4096
>>> nt = re.sub(u"XX", u".", text, re.U)
>>> nt
u'............XXXXXXXXXXXXXXXXXXX' (only 32 dots, the rest of the string is not changed).

If I first compile regexp, and then perform compiled_regexp.sub, everything seems to work correctly.
History
Date User Action Args
2011-02-20 22:28:14Eugene.Morozovsetrecipients: + Eugene.Morozov
2011-02-20 22:28:13Eugene.Morozovsetmessageid: <1298240893.99.0.359755744829.issue11262@psf.upfronthosting.co.za>
2011-02-20 22:28:09Eugene.Morozovlinkissue11262 messages
2011-02-20 22:28:09Eugene.Morozovcreate