added RegEx matching to validate user inputs