I wrote a string search algorithm.

It has a few limitations:
The length of the word is limited to 255 characters.
(This can be overcome by using numbers of a bigger type.)
It was written for search and replace, so it doesn't find overlapping words.
If it finds the word then the shift is equal to the length of the word.