using regex to check input