C#验证Email

使用C#来验证一个字符串是否为合法的Email地址:

public static bool IsEmail(string email)
{
    String strExp = @"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*";
    Regex r = new Regex(strExp);
    Match m = r.Match(email);
    return m.Success;
}
posted @ 2013-04-03 14:17  拓荒者FF  阅读(2832)  评论(1编辑  收藏  举报