...but is more effective for most cases

If you don't want to go for the usually fastest but more demanding method (that is: regular expressions and a $hfind(,R) lookup) but also don't want to use a while-loop that checks all words separately, this
"mixed" approach might be of use.