adding regex error handling in oprions.validate method