Validating email with regular expression
But it is not valid if your definition specifies that a valid email address is one that accepts mail.
Furthermore, the first and last characters in the local part and in the domain name must not be dots: This regular expression adds to the previous versions by specifying that the domain name must include at least one dot, and that the part of the domain name after the last dot can only consist of letters.
This reduces the number of emails returned to you as undeliverable.
This regular expression expands the previous one by allowing a larger set of rarely used characters in the local part.
Not only will we use regexes to do the validation but we’ll cover some other strategies.
It is incredibly difficult to build a good regex to handle all the validation scenarios.