diff options
author | Georg Brandl <georg@python.org> | 2010-08-01 21:40:25 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2010-08-01 21:40:25 (GMT) |
commit | b1a4e2c0b8eca4f7da9b562c6db5579f807fdd77 (patch) | |
tree | 8f038cc834661d94c9966ca28a341ea9ff25c7cf /Doc/library/re.rst | |
parent | 67a1d30f0d56d45217078829a1546fa2fe60857f (diff) | |
download | cpython-b1a4e2c0b8eca4f7da9b562c6db5579f807fdd77.zip cpython-b1a4e2c0b8eca4f7da9b562c6db5579f807fdd77.tar.gz cpython-b1a4e2c0b8eca4f7da9b562c6db5579f807fdd77.tar.bz2 |
Merged revisions 82832,82834 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k
........
r82832 | georg.brandl | 2010-07-12 11:00:29 +0200 (Mo, 12 Jul 2010) | 1 line
Take care of duplicate target name warnings.
........
r82834 | georg.brandl | 2010-07-12 11:06:13 +0200 (Mo, 12 Jul 2010) | 1 line
Use raw string literals for regexes containing backlash.
........
Diffstat (limited to 'Doc/library/re.rst')
-rw-r--r-- | Doc/library/re.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/re.rst b/Doc/library/re.rst index 2496835..448bcb7 100644 --- a/Doc/library/re.rst +++ b/Doc/library/re.rst @@ -1226,9 +1226,9 @@ in each word of a sentence except for the first and last characters:: ... random.shuffle(inner_word) ... return m.group(1) + "".join(inner_word) + m.group(3) >>> text = "Professor Abdolmalek, please report your absences promptly." - >>> re.sub("(\w)(\w+)(\w)", repl, text) + >>> re.sub(r"(\w)(\w+)(\w)", repl, text) 'Poefsrosr Aealmlobdk, pslaee reorpt your abnseces plmrptoy.' - >>> re.sub("(\w)(\w+)(\w)", repl, text) + >>> re.sub(r"(\w)(\w+)(\w)", repl, text) 'Pofsroser Aodlambelk, plasee reoprt yuor asnebces potlmrpy.' |