Tighten up that conditional check with a more concise regex