Added the option to check input against regex

Added the option to check the users input against a regular expression
with a custom error and valid message