Guido van Rossum <[EMAIL PROTECTED]> added the comment:

No, re.sub()'s documentation
(http://docs.python.org/library/re.html#re.sub)
makes it clear that \ followed by n in the replacement string is
interpreted.

To insert \ followed by n you have to double the \ inside the raw string
like this:

>>> re.sub('a', r'\\n', 'abba')
'\\nbb\\n'
>>>

----------
nosy: +gvanrossum
resolution:  -> invalid
status: open -> closed

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue4185>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to