summaryrefslogtreecommitdiffstats
path: root/Doc/library/re.rst
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2018-02-02 22:37:30 (GMT)
committerGitHub <noreply@github.com>2018-02-02 22:37:30 (GMT)
commitfbf8e823c02ac1c93a48609cc74e439e19ccb426 (patch)
treeb99a53c99dae6e0409c290b53e13ad0c80010870 /Doc/library/re.rst
parentf61951b10cc08d3926a3ebaacc154d4149150ef4 (diff)
downloadcpython-fbf8e823c02ac1c93a48609cc74e439e19ccb426.zip
cpython-fbf8e823c02ac1c93a48609cc74e439e19ccb426.tar.gz
cpython-fbf8e823c02ac1c93a48609cc74e439e19ccb426.tar.bz2
[3.6] bpo-32614: Modify re examples to use a raw string to prevent wa… …rning (GH-5265) (GH-5500)
Modify RE examples in documentation to use raw strings to prevent DeprecationWarning. Add text to REGEX HOWTO to highlight the deprecation. Approved by Serhiy Storchaka. (cherry picked from commit 66771422d0541289d0b1287bc3c28e8b5609f6b4)
Diffstat (limited to 'Doc/library/re.rst')
-rw-r--r--Doc/library/re.rst2
1 files changed, 1 insertions, 1 deletions
diff --git a/Doc/library/re.rst b/Doc/library/re.rst
index 874c8dd..db92c48 100644
--- a/Doc/library/re.rst
+++ b/Doc/library/re.rst
@@ -315,7 +315,7 @@ The special characters are:
This example looks for a word following a hyphen:
- >>> m = re.search('(?<=-)\w+', 'spam-egg')
+ >>> m = re.search(r'(?<=-)\w+', 'spam-egg')
>>> m.group(0)
'egg'