Test regex variables before using them