Home
Manage Your Code
Snippet: IsValidEmail (C#)
Title: IsValidEmail Language: C#
Description: Checks the email-address Views: 431
Author: Per Skute Date Added: 11/8/2006
Copy Code  
1        public bool IsValidEmail(string strIn)
2        {
3            // Return true if strIn is in valid e-mail format.
4            return Regex.IsMatch(strIn, @"^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$");
5        }