Use regular expression to check for inputs