Amaury Forgeot d'Arc added the comment: In other words, if I understand correctly: >>> re.sub('$', '#', 'a\nb\nc') 'a\nb\nc#' >>> re.sub('$', '#', 'a\nb\n') 'a\nb#\n#'
The first sample is correct, but the second one find two matches, even without the re.MULTILINE option. Is this normal? The docs say: > '$' Matches the end of the string or just before the newline at > the end of the string [...] It seems that it matches BOTH the end of the string AND just before the newline at the end of the string. ---------- nosy: +amaury.forgeotdarc __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1761> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com