Knuth-Morris-Pratt substring search