Email Validation

Email Validation

Given a email as input, you should write a regular expression that determines if the email id is a valid email id or not. You may assume all characters are from the English language.

Example 1:


input data:
admin#zedcoder.com
output:
false

Example 2:


input data:
seda123@zedcoder.com
output:
true
View Test Cases

b@d.net ---- true
a"b(c)d,e:f;gi[j\k]l@example.com ---- false
hfij#kjdfvkl ---- false
this is"not\allowed@example.com ---- false
1@d.net ---- true
@foo.com ---- false
very.common@example.com ---- true
A@b@c@example.com ---- false
niceandsimple@example.com ---- true
bob123@alice123.com ---- true
Abc.example.com ---- false
disposable.style.email.with+156@example.com ---- true
this\ still\"not\\allowed@example.com ---- false
just"not"right@example.com ---- false
b@domain.net ---- true
disposable.style.email.with+symbol@example.com ---- true
asterisk_domain@foo.* ---- false
this is not true ---- false
a.little.lengthy.but.fine@dept.example.com ---- true
"very.unusual.@.unusual.com"@example.com ---- true

View Java Solution

Seda
Seda Kunda is a web designer and developer with a degree in Computer Science and a great passion for code. Besides code, she enjoys pepperoni pizza, watching the bachelor and sleeping in on Saturdays.
Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn