in reply to Re: variable comparison
in thread variable comparison

Nope. That finds "Xtxt" because you aren't escaping the dot. Moral: don't use regex when a literal match will do, or learn about \Q.