emailid validation in this formate "[email protected]"
emailid validation in this formate "[email protected]"
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Shivanand ArurPosted Nov 20, 2012, 6:28 AM
http://regexlib.com/CheatSheet.aspx?AspxAutoDetectCookieSupport=1
http://regexlib.com/
Regex Cheat Library. U can get anything here that u want.
Hope this helps u.
Thanks.
Chintan RathodPosted Nov 20, 2012, 5:33 AM
Regular expression are powerful tools to check whether string match the case or not.
I had found a good article on Regular Expression for Email address checking. Having sample code here.
public static class TestEmail
{
///
/// Regular expression, which is used to validate an E-Mail address.
///
public const string MatchEmailPattern = @"^(([\w-]+\.)+[\w-]+|([a-zA-Z]{1}|[\w-]{2,}))@" + @"((([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]? [0-9]{1,2}|25[0-5]|2[0-4][0-9])\." + @"([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]? [0-9]{1,2}|25[0-5]|2[0-4][0-9])){1}|" + @"([a-zA-Z]+[\w-]+\.)+[a-zA-Z]{2,4})$";
///
/// Checks whether the given Email-Parameter is a valid E-Mail address.
///
/// Parameter-string that contains an E-Mail address.
///
/// contains a valid E-Mail address;
/// otherwise false.
public static bool IsEmail(string email)
{
if (email != null)
return Regex.IsMatch(email, MatchEmailPattern);
else
return false;
}
}
Link to this article is "Email Validation using Regular Expression"
Thanks & Regards
----------------------
Chintan Rathod