Use regex to test if user input is of the proper form