AS3 search engine (dynamic text strings)

It searches for text strings then automatically selects those relevent.
Is there a way to do this, is it hard and I am on my own?
If I use something like -

search.text == “hmmm”

it wont find things like “poo hmmm” or “hmm” or “hm”