Hmmm. Pretty good stuff.
I wouldn't use the Boyer-Moore algorithm, though. This is good for long strings - especially ones that have multiple searches applied.
But for short ones which are only going to be searched once, then the creation of the distance table make the use of the algorithm inefficient.
I suppose you could optimise further by having some sort of threshold where the Boyer-Moore would take over . . .
(BTW - Nice touch avoiding the copy!)




Reply With Quote