mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
Issue #23622: Unknown escapes in regular expressions that consist of `'\'
`
and ASCII letter now raise a deprecation warning and will be forbidden in Python 3.6.
This commit is contained in:
parent
793c14ea29
commit
a54aae0683
6 changed files with 60 additions and 19 deletions
|
@ -87,7 +87,7 @@ tests = [
|
|||
(r'[\a][\b][\f][\n][\r][\t][\v]', '\a\b\f\n\r\t\v', SUCCEED, 'found', '\a\b\f\n\r\t\v'),
|
||||
# NOTE: not an error under PCRE/PRE:
|
||||
(r'\u', '', SYNTAX_ERROR), # A Perl escape
|
||||
(r'\c\e\g\h\i\j\k\m\o\p\q\y\z', 'ceghijkmopqyz', SUCCEED, 'found', 'ceghijkmopqyz'),
|
||||
# (r'\c\e\g\h\i\j\k\m\o\p\q\y\z', 'ceghijkmopqyz', SUCCEED, 'found', 'ceghijkmopqyz'),
|
||||
(r'\xff', '\377', SUCCEED, 'found', chr(255)),
|
||||
# new \x semantics
|
||||
(r'\x00ffffffffffffff', '\377', FAIL, 'found', chr(255)),
|
||||
|
@ -607,8 +607,8 @@ xyzabc
|
|||
# new \x semantics
|
||||
(r'\x00ff', '\377', FAIL),
|
||||
# (r'\x00ff', '\377', SUCCEED, 'found', chr(255)),
|
||||
(r'\t\n\v\r\f\a\g', '\t\n\v\r\f\ag', SUCCEED, 'found', '\t\n\v\r\f\ag'),
|
||||
('\t\n\v\r\f\a\g', '\t\n\v\r\f\ag', SUCCEED, 'found', '\t\n\v\r\f\ag'),
|
||||
(r'\t\n\v\r\f\a', '\t\n\v\r\f\a', SUCCEED, 'found', '\t\n\v\r\f\a'),
|
||||
('\t\n\v\r\f\a', '\t\n\v\r\f\a', SUCCEED, 'found', '\t\n\v\r\f\a'),
|
||||
(r'\t\n\v\r\f\a', '\t\n\v\r\f\a', SUCCEED, 'found', chr(9)+chr(10)+chr(11)+chr(13)+chr(12)+chr(7)),
|
||||
(r'[\t][\n][\v][\r][\f][\b]', '\t\n\v\r\f\b', SUCCEED, 'found', '\t\n\v\r\f\b'),
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue