If the pattern isn’t found, string is returned unchanged. repl can be a string or a function; if it is a string, any backslash escapes in it are processed. That is, \n is converted to a single newline character, \r is converted to a carriage return, and so forth. Unknown escapes such as \j are left alone.
# Bon, en fait c'est documenté ...
Posté par Pol' uX (site web personnel) . En réponse au message Python, substitution et regex. Évalué à 2.
http://docs.python.org/library/re.html#re.sub
Adhérer à l'April, ça vous tente ?