tweak: improve a condition for $regex operator