Is there a maximum length of a regular expression in python?
Tim Peters
tim.peters at gmail.com
Fri Jan 20 21:49:04 EST 2006
[Bryan Olson]
>> Does no one care about an internal error in the regular expression
>> engine?
[Steve Holden]
> Not one that requires parsing a 100 kilobyte re that should be replaced
> by something more sensible, no.
I care: this is a case of not detecting information loss due to
unchecked downcasting in C, and it was pure luck that it resulted in
an internal re error rather than, say, a wrong result. God only knows
what other pathologies the re engine could tricked into exhibiting
this way. Python 2.5 will raise an exception instead, during regexp
compilation (I just checked in code for this on the trunk; with some
luck, someone will backport that to 2.4 too).
More information about the Python-list
mailing list