Message230217
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' |
|
Date |
User |
Action |
Args |
2014-10-29 15:49:42 | peter.otten | set | recipients:
+ peter.otten, ezio.melotti, mrabarnett, serhiy.storchaka, mgdelmonte |
2014-10-29 15:49:42 | peter.otten | set | messageid: <1414597782.09.0.859698455471.issue22760@psf.upfronthosting.co.za> |
2014-10-29 15:49:42 | peter.otten | link | issue22760 messages |
2014-10-29 15:49:42 | peter.otten | create | |
|