Bit substring search

Kris Kennaway kris at FreeBSD.org
Wed Jun 25 17:00:15 CEST 2008


Scott David Daniels wrote:
> Kris Kennaway wrote:
>> Thanks for the pointers, I think a C extension will end up being the 
>> way to go, unless someone has beaten me to it and I just haven't found 
>> it yet.
> 
> Depending on the pattern length you are targeting, it may be fastest to
> increase the out-of-loop work.  For a 40-bit string, build an 8-target
> Aho-Corasick machine, and at each match check the endpoints.  This will
> only work well if 40 bits is at the low end of what you are hunting for.

Thanks, I wasn't aware of Aho-Corasick.

Kris




More information about the Python-list mailing list