try knuth-morris-pratt algorithm or kmp search...
aho-corsasick would be better but kmp is easier to understand

Reply via email to