This is extremely slow.

Instead, use a regex and `\b` to match a word boundary.