The search function in a plaintext editor shouldn't and won't strip non-displaying characters.
A simple regex like
would find the word "foobar" with optional soft hyphens. Note: the at symbols are a placeholder for the aforementioned unicode character.
You will indeed need a regex, because regexes are by definition what you use to find a fragment of text that can appear in multiple forms -- which is the case here.
On the other hand, I would venture to say, the best solution is... don't hyphenate the book until it reaches production and goes on your ereader. Remove all symbols from the book (de-hyphenate it) and searching in ebook-editors will work properly.
Then hyphenate them when they are ready to be pushed to your device. The ereader/app should handle searching just fine, much like the way they don't break on span tags.