You&#x27;re taking regex hate way too far. This is actually pretty much an <i>ideal</i> use-case for regular expressions. The correct regular expression looks like &#x2F;\b[Tt]est&#x2F;, which is trivial to write by anyone who has a passing familiarity by regex, easy to read, and will do exactly what it&#x27;s trying to do.