Currently in Vaadin 14.6.8 the EmailField accept these values (e.g. "[email protected]", "[email protected]") as valid input. Should I consider those as valid EMail Addresses ?
EmailField emailField = new EmailField();
Already searched in the net and already verified with some online email address validator.
EmailField
has fairly simple regexp pattern for performance reasons to validate that input is roughly looking like e-mail. Writing complete regexp pattern to validate input against RFC 5322 is tedious task as seen in this discussion (note that complex regexp patterns are also prone to ReDoS attacks)
How can I validate an email address using a regular expression?
If you are not satisfied with EmailField
, there is TextField#setPattern(regexp)
method, which can be used instead of EmailField
if you want to use more complex validation pattern. You will notice that some pragmatic compromise is needed.