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  拓荒者IT  阅读(2844)  评论(1)    收藏  举报
皮肤配置 参考地址:https://www.yuque.com/awescnb/user