So you think you can validate email addresses
What is valid email?
How do you know? How do you validate an email?
Which of these emails are valid?
- hi@stavros.io ==Valid
- hi@ ==Invalid. No domain
- hi+there@stavros.io ==Valid
- stavros.k@stavros.io ==Valid
- stavros.@stavros.io ==Invalid. Can't have dot at the end
- stavros..k@stavros.io ==Invalid --- Can't have two dots in a row -!#$%&'#(-/=?@stavros.io ==Invalid
- f*ck@stavros.io == Valid
- #$%!^/&@stavros.io ==Valid
- h(a)i@stavros.io ==Invalid. No parentheses allowed! (Are you kidding me?)
- (sta)vros@stavros.io ==Valid. Its comment and will be ignored by the mail server -stavros@stavros.io(io) ==Still Valid
- em@il@stavros.io ==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"@"you@stavros.io ==Invalid. Qoutes must be dot-sparated
Conclusion
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