Function IsValidEmail(ByVal processMail As System.String) As System.Boolean Return System.Text.RegularExpressions.Regex.IsMatch(processMail, "^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))" & _ "([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$") End Function
string strEmail = "xrascal@163com";
if( Regex.IsMatch(strEmail ,pattern) )
{
Response.Write(" Match !");
}
else
{
Response.Write(" that is wrong !");
}
using System.Text.RegularExpressions;
if(Regex.IsMatch(Email输入框.Text,@"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"))
{
正确
}
else
{
错误
}
\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
"([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$")
End Function
http://www.codeproject.com/useritems/Valid_Email_Addresses.asp