summaryrefslogtreecommitdiff
path: root/Lib/sre_constants.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-10-31 12:36:56 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2014-10-31 12:36:56 +0200
commit476b2c58f65dacacd1146a92e1cce8717cd96070 (patch)
treeca6fda0a0943251f9a8592b9ff776b723254a87a /Lib/sre_constants.py
parent3c777861a281a44b5adec106cf4a7d9566a58175 (diff)
downloadcpython-476b2c58f65dacacd1146a92e1cce8717cd96070.tar.gz
Issue #17381: Fixed handling of case-insensitive ranges in regular expressions.
Added new opcode RANGE_IGNORE.
Diffstat (limited to 'Lib/sre_constants.py')
-rw-r--r--Lib/sre_constants.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/sre_constants.py b/Lib/sre_constants.py
index 8815d1d487..8296ecdb70 100644
--- a/Lib/sre_constants.py
+++ b/Lib/sre_constants.py
@@ -13,7 +13,7 @@
# update when constants are added or removed
-MAGIC = 20031017
+MAGIC = 20140917
from _sre import MAXREPEAT, MAXGROUPS
@@ -56,6 +56,7 @@ NEGATE = "negate"
NOT_LITERAL = "not_literal"
NOT_LITERAL_IGNORE = "not_literal_ignore"
RANGE = "range"
+RANGE_IGNORE = "range_ignore"
REPEAT = "repeat"
REPEAT_ONE = "repeat_one"
SUBPATTERN = "subpattern"
@@ -121,7 +122,8 @@ OPCODES = [
REPEAT,
REPEAT_ONE,
SUBPATTERN,
- MIN_REPEAT_ONE
+ MIN_REPEAT_ONE,
+ RANGE_IGNORE,
]
@@ -159,7 +161,8 @@ OP_IGNORE = {
GROUPREF: GROUPREF_IGNORE,
IN: IN_IGNORE,
LITERAL: LITERAL_IGNORE,
- NOT_LITERAL: NOT_LITERAL_IGNORE
+ NOT_LITERAL: NOT_LITERAL_IGNORE,
+ RANGE: RANGE_IGNORE,
}
AT_MULTILINE = {