[issue22760] re.sub does only first 16 replacements if re.S is used

2014-10-29 Thread Michael Del Monte
New submission from Michael Del Monte: Easily reproduced: re.sub('x', 'a', x*20, re.S) returns '' -- components: Regular Expressions messages: 230216 nosy: ezio.melotti, mgdelmonte, mrabarnett priority: normal severity: normal status: open title: re.sub does only

[issue22760] re.sub does only first 16 replacements if re.S is used

2014-10-29 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22760 ___ ___ Python-bugs-list

[issue22760] re.sub does only first 16 replacements if re.S is used

2014-10-29 Thread Peter Otten
Peter Otten added the comment: 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

[issue22760] re.sub does only first 16 replacements if re.S is used

2014-10-29 Thread Georg Brandl
Georg Brandl added the comment: The fourth parameter is not flags, but count, the max. number of substitutions. flags is the fifth parameter, or give it as a keyword argument. -- nosy: +georg.brandl resolution: - not a bug status: open - closed

[issue22760] re.sub does only first 16 replacements if re.S is used

2014-10-29 Thread STINNER Victor
STINNER Victor added the comment: This bug report is common. An enhancement would be to make the count parameter a keyword only parameter. Would it break a lot of code? -- nosy: +haypo ___ Python tracker rep...@bugs.python.org

[issue22760] re.sub does only first 16 replacements if re.S is used

2014-10-29 Thread Ezio Melotti
Ezio Melotti added the comment: See #11957. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22760 ___ ___ Python-bugs-list mailing list

[issue22760] re.sub does only first 16 replacements if re.S is used

2014-10-29 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- resolution: not a bug - duplicate superseder: - re.sub confusion between count and flags args ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22760