^localhost ¦.+\..+\.com$¦.+\..+\.cn$¦.+\..+\.net$
说在\. 这里错误无法识别的转义序列

解决方案 »

  1.   

    嗯 没有报错啊. string strString = @"^localhost ¦.+\..+\.com$¦.+\..+\.cn$¦.+\..+\.net$";
     string strFind = txtFind.Text; Regex r = new Regex(strFind);
     Match m = r.Match(strString);
     txtResult.Text = m.Value;
      

  2.   

    我直接用在验证控件上面,报错了

    string regulardomail = "^localhost ¦.+\..+\.com$¦.+\..+\.cn$¦.+\..+\.net$";
    RegularExpressionValidatorDomain.ValidationExpression = regulardomail;
      

  3.   

    求ValidationExpression 域名 表达式
    要求可以
    localhost
    xxx.domain.com (net、com.cn、org、cn)
    这二种形式
      

  4.   

    string regulardomail = @"^localhost ¦.+\..+\.com$¦.+\..+\.cn$¦.+\..+\.net$";