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 mrabarnett
Recipients Stephen.Evans, ezio.melotti, mrabarnett
Date 2015-04-28.19:38:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1430249924.47.0.99508216447.issue24071@psf.upfronthosting.co.za>
In-reply-to
Content
The 4th argument of re.sub is the maximum count (0 means unlimited).

>>> help(re.sub)
Help on function sub in module re:

sub(pattern, repl, string, count=0, flags=0)
    Return the string obtained by replacing the leftmost
    non-overlapping occurrences of the pattern in string by the
    replacement repl.  repl can be either a string or a callable;
    if a string, backslash escapes in it are processed.  If it is
    a callable, it's passed the match object and must return
    a replacement string to be used.

The value of re.MULTILINE is 8:

>>> re.MULTILINE
8

therefore it'll perform a maximum of 8 substitutions.

In summary: not a bug.
History
Date User Action Args
2015-04-28 19:38:44mrabarnettsetrecipients: + mrabarnett, ezio.melotti, Stephen.Evans
2015-04-28 19:38:44mrabarnettsetmessageid: <1430249924.47.0.99508216447.issue24071@psf.upfronthosting.co.za>
2015-04-28 19:38:44mrabarnettlinkissue24071 messages
2015-04-28 19:38:44mrabarnettcreate