in reply to search for exact string

It is, of course, perfectly reasonable to write an if statement with more than one regular-expression test in it ... using or.

Pay not the slightest attention to concerns of “efficiency,” for there are none.