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 effbot
Recipients amaury.forgeotdarc, effbot, facundobatista, georg.brandl, gvanrossum, jmravon
Date 2008-01-09.13:30:19
SpamBayes Score 0.004576723
Marked as misclassified No
Message-id <1199885420.88.0.100438219652.issue1761@psf.upfronthosting.co.za>
In-reply-to
Content
For the record, $ is defined to match "before a newline at the end of
the string, or at the end of the string" in normal mode, and "before any
newline, or at the end of the string" in multiline mode.

(and I have a vague memory that the "before a newline" behaviour in
normal mode was added for Perl compatibility)

> It seems that it matches BOTH the end of the string AND just before
the newline at the end of the string.

Of course it does: re.sub scans the string for matches from left to
right, and does the substitution everywhere the pattern matches, only
skipping over the matched parts.  Or in other words, if a pattern
matches N characters on position X has no influence on whether it
matches on position X+N or not.
History
Date User Action Args
2008-01-09 13:30:21effbotsetspambayes_score: 0.00457672 -> 0.004576723
recipients: + effbot, gvanrossum, georg.brandl, facundobatista, amaury.forgeotdarc, jmravon
2008-01-09 13:30:20effbotsetspambayes_score: 0.00457672 -> 0.00457672
messageid: <1199885420.88.0.100438219652.issue1761@psf.upfronthosting.co.za>
2008-01-09 13:30:20effbotlinkissue1761 messages
2008-01-09 13:30:19effbotcreate