Checks if string matches provided regex and throws an error with either default or custom message, if match failed.
Custom message is useful, in case you want to have a more human-readable message.
Validation passes if value is empty. If it must fail, delegate this check to .required() extension method.
Checks if string matches provided regex and throws an error with either default or custom message, if match failed. Custom message is useful, in case you want to have a more human-readable message. Validation passes if value is empty. If it must fail, delegate this check to
.required()
extension method.