summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-11-28 20:51:38 (GMT)
committerGitHub <noreply@github.com>2017-11-28 20:51:38 (GMT)
commitc615be5166ed338c052fa67fe781b9bfe0dfb78c (patch)
treefb87716b20d5e5ff326b37d4c23c3d212eacee1e /Doc/library
parentac577d7d0bd27a69921ced14c09172235ceebab5 (diff)
downloadcpython-c615be5166ed338c052fa67fe781b9bfe0dfb78c.zip
cpython-c615be5166ed338c052fa67fe781b9bfe0dfb78c.tar.gz
cpython-c615be5166ed338c052fa67fe781b9bfe0dfb78c.tar.bz2
Use raw strings in the re module examples. (#4616)
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/re.rst8
1 files changed, 4 insertions, 4 deletions
diff --git a/Doc/library/re.rst b/Doc/library/re.rst
index 8c15462..8e6eb30 100644
--- a/Doc/library/re.rst
+++ b/Doc/library/re.rst
@@ -689,11 +689,11 @@ form.
splits occur, and the remainder of the string is returned as the final element
of the list. ::
- >>> re.split('\W+', 'Words, words, words.')
+ >>> re.split(r'\W+', 'Words, words, words.')
['Words', 'words', 'words', '']
- >>> re.split('(\W+)', 'Words, words, words.')
+ >>> re.split(r'(\W+)', 'Words, words, words.')
['Words', ', ', 'words', ', ', 'words', '.', '']
- >>> re.split('\W+', 'Words, words, words.', 1)
+ >>> re.split(r'\W+', 'Words, words, words.', 1)
['Words', 'words, words.']
>>> re.split('[a-f]+', '0a3B9', flags=re.IGNORECASE)
['0', '3', '9']
@@ -702,7 +702,7 @@ form.
the string, the result will start with an empty string. The same holds for
the end of the string::
- >>> re.split('(\W+)', '...words, words...')
+ >>> re.split(r'(\W+)', '...words, words...')
['', '...', 'words', ', ', 'words', '...', '']
That way, separator components are always found at the same relative