min, max = 0, 1
elif this == "*":
min, max = 0, MAXREPEAT
+
elif this == "+":
min, max = 1, MAXREPEAT
elif this == "{":
if subpattern:
item = subpattern[-1:]
else:
+ item = None
+ if not item or (len(item) == 1 and item[0][0] == AT):
raise error, "nothing to repeat"
if item[0][0] in (MIN_REPEAT, MAX_REPEAT):
raise error, "multiple repeat"
(r'(?i)m+', 'MMM', SUCCEED, 'found', 'MMM'),
(r'(?i)[M]+', 'MMM', SUCCEED, 'found', 'MMM'),
(r'(?i)[m]+', 'MMM', SUCCEED, 'found', 'MMM'),
+ # bug 130748: ^* should be an error (nothing to repeat)
+ (r'^*', '', SYNTAX_ERROR),
]