added additional solutions for regex and exception handling