in reply to Optimizing string searches

Use a sliding window and if you're looking for constants use index() instead of a regex.