diff options
author | Raymond Hettinger <python@rcn.com> | 2013-03-01 11:30:20 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2013-03-01 11:30:20 (GMT) |
commit | faaba59977036da9f4179ef426e0862251110ba0 (patch) | |
tree | 9af31777e01452020c4416524a5b5e065410e0ca /Doc | |
parent | f79493bf9ebb191f06083fdcd0bce4626641b4ac (diff) | |
download | cpython-faaba59977036da9f4179ef426e0862251110ba0.zip cpython-faaba59977036da9f4179ef426e0862251110ba0.tar.gz cpython-faaba59977036da9f4179ef426e0862251110ba0.tar.bz2 |
Regex should be a raw string
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/collections.rst | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index 6ef114e..a65fe5b 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -210,7 +210,7 @@ For example:: >>> # Find the ten most common words in Hamlet >>> import re - >>> words = re.findall('\w+', open('hamlet.txt').read().lower()) + >>> words = re.findall(r'\w+', open('hamlet.txt').read().lower()) >>> Counter(words).most_common(10) [('the', 1143), ('and', 966), ('to', 762), ('of', 669), ('i', 631), ('you', 554), ('a', 546), ('my', 514), ('hamlet', 471), ('in', 451)] |