diff options
author | Raymond Hettinger <python@rcn.com> | 2013-02-28 19:11:11 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2013-02-28 19:11:11 (GMT) |
commit | dce969d2b05238755771bd9c65d86df182ab8390 (patch) | |
tree | 9f25de20445ec5528443f1e1db320bbc456f28a1 | |
parent | 1fef1eb6e97c730cecd0c180764bdefd0c449f6e (diff) | |
download | cpython-dce969d2b05238755771bd9c65d86df182ab8390.zip cpython-dce969d2b05238755771bd9c65d86df182ab8390.tar.gz cpython-dce969d2b05238755771bd9c65d86df182ab8390.tar.bz2 |
The example regex should be a raw string.
-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 be551dc..0fc7fac 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -51,7 +51,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)] |