Regular expression for validating website
This does not mean that other users cannot access this mailbox, for example when the user makes use of a service that generates a throw away email address.
As the local-part of email addresses are, in fact - case sensitive, it is important to store and compare email addresses correctly.
To normalise an email address input, you would convert the domain part ONLY to lowercase.
Input validation should happen as early as possible in the data flow, preferably as soon as the data is received from the external party.
Input validation should be applied on both syntactical and semantic level.
Syntactic validation should enforce correct syntax of structured fields (e.g.
SSN, date, currency symbol) while semantic validation should enforce correctness of their values in the specific business context (e.g.
start date is before end date, price is within expected range).