mirror of
https://github.com/python/cpython.git
synced 2025-11-01 02:38:53 +00:00
bpo-32614: Modify re examples to use a raw string to prevent warning (GH-5265)
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.
This commit is contained in:
parent
bbbcf8693b
commit
66771422d0
4 changed files with 24 additions and 6 deletions
|
|
@ -463,7 +463,7 @@ The string in this example has the number 57 written in both Thai and
|
|||
Arabic numerals::
|
||||
|
||||
import re
|
||||
p = re.compile('\d+')
|
||||
p = re.compile(r'\d+')
|
||||
|
||||
s = "Over \u0e55\u0e57 57 flavours"
|
||||
m = p.search(s)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue