Pathological regular expression

franck pommereau at
Fri Apr 17 22:48:06 CEST 2009

> To my mind, this is a bug in the RE engine. Is there any reason to not
> treat it as a bug?

It's not a bug, it's a feature! ;-)
Indeed, in order to handle constructs like (?P=name), RE engines have
to use inefficient algorithms. In my opinion, this is not the problem
of using a pathological regular expression, but rather a problem of
the RE engine that is not optimized to use the faster approach when

This is well known problem very well explained on:


More information about the Python-list mailing list