Regular expression guaranteed to fail

Hallvard B Furuseth h.b.furuseth at
Tue Aug 24 22:08:29 CEST 2004

Eric Brunel wrote:
>Hallvard B Furuseth wrote:
>> Anyway, I note that r'x\A' beats all the other regexps suggested so far
>> with a factor of 20 when searching 's'*10000.
> And when searching 'x'*10000? Since there is an 'x' in the re, it may change
> things a lot...

Heh.  You are right: That's about almost as slow as the others.  A bit
slower than \Zx and \Ax\A, but still faster than the other alternatives.


More information about the Python-list mailing list