Use regex to verify that user input is valid