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.
Loading
VulpesPosted Mar 12, 2014, 6:46 AM
1. One '@'
2. At least one '.'
string regExp = @"^[a-zA-Z0-9]+\.?[a-zA-Z0-9]+@[a-zA-Z0-9]+(\.[a-zA-Z0-9]+)+$";
Abhay ShankerPosted Mar 12, 2014, 1:38 AM
^([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
Lakshmanan Sethu SankaranarayanPosted Mar 12, 2014, 12:56 AM