What is valid email?
How do you know? How do you validate an email?
Which of these emails are valid?
- firstname.lastname@example.org ==Valid
- hi@ ==Invalid. No domain
- email@example.com ==Valid
- firstname.lastname@example.org ==Valid
- stavros.@stavros.io ==Invalid. Can't have dot at the end
- stavros..email@example.com ==Invalid --- Can't have two dots in a row -!#$%&'#(-/=?@stavros.io ==Invalid
- firstname.lastname@example.org == Valid
- #$%!^/&@stavros.io ==Valid
- h(a)email@example.com ==Invalid. No parentheses allowed! (Are you kidding me?)
- (sta)firstname.lastname@example.org ==Valid. Its comment and will be ignored by the mail server -email@example.com(io) ==Still Valid
- em@firstname.lastname@example.org ==Invalid. Because you have two at signs
- "<\"@\".!#%$@stavros.io ==Invalid
- <\"@\".!#%$@stavros.io ==Invalid
- "hi@you"@stavros.io ==Valid. You can have quoted at sign
- "hi you"@stavros.io ==Valid.
- " "@stavros.io ==Valid.
- hi"@"email@example.com ==Invalid. Qoutes must be dot-sparated
This video is amazingly mind blowing. You have to watch it if you have ever done email validation and thought you got it right. You will be puzzled.
The list above is not complete