mirror of
https://github.com/python/cpython.git
synced 2025-07-19 09:15:34 +00:00
bpo-30349: Raise FutureWarning for nested sets and set operations (#1553)
in regular expressions.
This commit is contained in:
parent
3daaafb700
commit
05cb728d68
8 changed files with 106 additions and 9 deletions
|
@ -251,8 +251,9 @@ def template(pattern, flags=0):
|
|||
# SPECIAL_CHARS
|
||||
# closing ')', '}' and ']'
|
||||
# '-' (a range in character set)
|
||||
# '&', '~', (extended character set operations)
|
||||
# '#' (comment) and WHITESPACE (ignored) in verbose mode
|
||||
_special_chars_map = {i: '\\' + chr(i) for i in b'()[]{}?*+-|^$\\.# \t\n\r\v\f'}
|
||||
_special_chars_map = {i: '\\' + chr(i) for i in b'()[]{}?*+-|^$\\.&~# \t\n\r\v\f'}
|
||||
|
||||
def escape(pattern):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue