Implemented hash to check regular expression then multiple if-elsif statements.