Valid Email Address Checking

Posted by imomins on May 12, 2011 at 7:56 AM

public static bool isEmail(string inputEmail)

{

inputEmail = NulltoString(inputEmail);

string strRegex = @"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}" +

@"\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\" +

@".)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$";

Regex re = new Regex(strRegex);

if (re.IsMatch(inputEmail))

return (true);

else

return (false);


Categories: Personal, C#

Post a Comment

Oops!

Oops, you forgot something.

Oops!

The words you entered did not match the given text. Please try again.

You must be a member to comment on this page. Sign In or Register

0 Comments