用户输入的有可能是多个邮件地址,与outlook中输入收件人一样。[email protected]
[email protected];[email protected];[email protected]; 多个email用分号“;”隔开。

解决方案 »

  1.   

    if(Regex.IsMatch(yourEmail,@"\b([a-zA-Z]*\w*@\w+(\.\w+)*;?)+"))
    {
    //ok,正确格式
    }
      

  2.   

    public static bool checkEmail(string strEmail){    return System.Text.RegularExpressions.Regex.IsMatch(strEmail, @"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*");}
      

  3.   

    public static bool checkEmail(string strEmail){    return System.Text.RegularExpressions.Regex.IsMatch(strEmail, @"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*");}
      

  4.   

    都不正确哦,用下面的去试试。[email protected];adfa;adsfa
      

  5.   

    if(Regex.IsMatch(yourEmail,@"^([a-zA-Z]*\w*@\w+(\.\w+)*;?)+$"))
    {
    //ok,正确格式
    }
      

  6.   

    [email protected];adfa;adsfa===
    有这样的邮箱?
      

  7.   

     if (Regex.IsMatch("要验证的邮箱地址", @"\w{1,}@\w{1,}\.com\b"))
    {
    //执行代码;
    }
    注:\b作用:邮件地址必须以.com结束标志
      

  8.   

    我是说用以下的去匹配出来结果为True.注意:没有规定是一定要.com,就是outlook中的收件人输入验证一样,可以多个。
      

  9.   

    我也没写要求.com啊?
    分号分隔的应该都是邮箱地址,邮箱地址至少需要一个@,如果这个都没有,你不用判断了。所有字符不都符合你要求么?
    [email protected];test
    这样都符合的话,你还用正则验证什么?没规则了。