Possible 2.0b2 bug: Recursion limit in non-greedy regular expressions

Darrell Gallion darrell at dorb.com
Fri Sep 29 21:25:25 EDT 2000


I posted a patch. Although I'm sure the patch will need some
work, it solved only my immediate need. Suspect this error might still occur
with other patterns.

Here's a solution, hopefully posting these won't get me into trouble :)

http://dorb.com/darrell/dropPoint/_sre.pyd
http://dorb.com/darrell/dropPoint/_sre.c

--Darrell

From: "Richie Hindle"
> longish strings.  If I run the following code in 2.0b2:
>
> >>> re.match( 'a.*?b', 'a' + 'c' * 16167 )
>
> it fails with "RuntimeError: maximum recursion limit exceeded".
> Decreasing the number of 'c's to 16166 makes it OK.
>







More information about the Python-list mailing list