Author peter.otten
Recipients ezio.melotti, mgdelmonte, mrabarnett, peter.otten, serhiy.storchaka
Date 2014-10-29.15:49:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1414597782.09.0.859698455471.issue22760@psf.upfronthosting.co.za>
In-reply-to
Content
This is not a bug; the signature of re.sub() is

sub(pattern, repl, string, count=0, flags=0)

and the fourth argument thus the 'count' delimiting the number of substitutions that you accidentally specify as

>>> import re
>>> re.S
16

I recommend that you use a keyword arg to fix your code:

>>> re.sub('x', 'a', "x"*20, flags=re.S)
'aaaaaaaaaaaaaaaaaaaa'
History
Date User Action Args
2014-10-29 15:49:42peter.ottensetrecipients: + peter.otten, ezio.melotti, mrabarnett, serhiy.storchaka, mgdelmonte
2014-10-29 15:49:42peter.ottensetmessageid: <1414597782.09.0.859698455471.issue22760@psf.upfronthosting.co.za>
2014-10-29 15:49:42peter.ottenlinkissue22760 messages
2014-10-29 15:49:42peter.ottencreate