dim str as regex
 str=new regex("[b[iao]t")if str.IsMatch("bat") then
  response.write("ok")
end if

解决方案 »

  1.   

    驗証控件最后也是转换成javascript的。你用js的RegEx对象可以做正则。
      

  2.   

    .net introduced regular expression, see System.Text.RegularExpressions NamespaceRegular expression was introduced by java and .net, originally, java did not support it.
      

  3.   

    给你一个例子。
    Regex rCode = new Regex("^\\d{6}$");
    if (!rCode.IsMatch(TextBox_SecCode.Text))
    {
    txtSecInfo.Text = "证券代码输入错误";
    txtSecInfo.Visible = true;
    Table1.Visible = false;
    return ;
    }注:别忘了 using System.Text.RegularExpressions
      

  4.   

    比如限制为Email RegularExpression="^[a-zA-Z0-9]{1,}@[a-zA-Z0-9]{1,}(com|net|org|edu|mil|cn|cc)$"
      

  5.   

    但是IsMatch()函数只能判断一次,就是当第一次匹配之后,以后如果不匹配,那么也显示匹配的结果,如何处理呢?
      

  6.   

    Dim re1 As New RegularExpressionValidator()
            re1.ValidationExpression = "^[a-z]{1,}"
            re1.ControlToValidate = TextBox1.Text
            If re1.IsValid Then        End If
      

  7.   

    to  tix66(网络游仔) :不行呀,总是通过验证