Commit 26d6a5ca authored by Fredrik Lundh's avatar Fredrik Lundh

SRE didn't handle character category followed by hyphen inside a

character class.  Fix provided by Andrew Kuchling.  Closes bug
#116251.
parent 53d915ea
...@@ -393,6 +393,8 @@ def _parse(source, state): ...@@ -393,6 +393,8 @@ def _parse(source, state):
# potential range # potential range
this = source.get() this = source.get()
if this == "]": if this == "]":
if code1[0] is IN:
code1 = code1[1][0]
set.append(code1) set.append(code1)
set.append((LITERAL, ord("-"))) set.append((LITERAL, ord("-")))
break break
......
...@@ -619,4 +619,6 @@ xyzabc ...@@ -619,4 +619,6 @@ xyzabc
(r' (?x)foo ', 'foo', SUCCEED, 'found', 'foo'), (r' (?x)foo ', 'foo', SUCCEED, 'found', 'foo'),
# bug 115618: negative lookahead # bug 115618: negative lookahead
(r'(?<!abc)(d.f)', 'abcdefdof', SUCCEED, 'found', 'dof'), (r'(?<!abc)(d.f)', 'abcdefdof', SUCCEED, 'found', 'dof'),
# bug 116251: character class bug
(r'[\w-]+', 'laser_beam', SUCCEED, 'found', 'laser_beam'),
] ]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment