(r'(?i)[m]+', 'MMM', SUCCEED, 'found', 'MMM'),
# bug 130748: ^* should be an error (nothing to repeat)
(r'^*', '', SYNTAX_ERROR),
+ # bug 133283: minimizing repeat bug
+ (r'"(?:\\"|[^"])*?"', r'"\""', SUCCEED, 'found', r'"\"'),
]
try:
# implementation of repeated groups.
test("sre.match('(x)*', 50000*'x').span()", (0, 50000), RuntimeError)
test("sre.match(r'(x)*y', 50000*'x'+'y').span()", (0, 50001), RuntimeError)
-test("sre.match(r'(x)*?y', 50000*'x'+'y').span()", (0, 50001), RuntimeError)
+test("sre.match(r'(x)*?y', 50000*'x'+'y').span()", (0, 50001))
from re_tests import *
/* see if the tail matches */
state->repeat = rp->prev;
/* FIXME: the following fix doesn't always work (#133283) */
- if (0 && rp->pattern[2] == 65535) {
+ if (rp->pattern[2] == 65535) {
/* unbounded repeat */
for (;;) {
i = SRE_MATCH(state, pattern, level + 1);