The major difference is that your loop makes multiple passes through the string, and davidrw's does not. Depending on the size of the string and how many search terms there are, the performance difference can be quite significant.
Caution: Contents may have been coded under pressure.