The reqular expression which I require for an email validator in c# should allow
1.All characters[a-z A-Z]
2.0-9
3.All alphanumeric characters
The only requirement is that the format must have "@" and "."
eg:[email protected]
The expression can accept any character.
Appreciate any help from your side.
Reqular Expression for Email
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Lakshmanan Sethu SankaranarayanRank #124 · 17.7K reputationPosted Mar 11, 2014, 8:56 PM EDT
Abhay ShankerRank #375 · 6.7K reputationPosted Mar 11, 2014, 9:38 PM EDT
^([0-9a-zA-Z]([-\\.\\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\\w]*[0-9a-zA-Z]\\.)+[a-zA-Z]{2,9})$
or
[a-zA-Z0-9_\-\.]+@[a-zA-Z0-9_\-\.]+\.[a-zA-Z]{2,5}
or
\A(?:[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?)\Z
VulpesRank #55 · 29.2K reputationPosted Mar 12, 2014, 2:46 AM EDT
1. One '@'
2. At least one '.'
string regExp = @"^[a-zA-Z0-9]+\.?[a-zA-Z0-9]+@[a-zA-Z0-9]+(\.[a-zA-Z0-9]+)+$";