intstr(aaaa,你的目标字符串,1)=true

解决方案 »

  1.   

    不需要用正则就可以实现吧,myString.IndexOf(aaaa)>0
      

  2.   

    If string.IndexOf("ttttt")<0 Then
    没找到
      

  3.   

    这样要是中文比如:aaa="小王"
    使用以上函数时,是不是"小"或"王"都能匹配?
    另,正则表达式中是不是不能应用变量?如能,请举一个例子
      

  4.   

    页面
    <asp:TextBox id="TB_Regex" runat="server">小王</asp:TextBox>
    <asp:TextBox id="TB_Text" runat="server">我是不是小王</asp:TextBox>
    <asp:Button id="Btn_Test" runat="server" Text="Button"></asp:Button>按钮事件
    private void Btn_Test_Click(object sender, System.EventArgs e)
    {
    string strReg=this.TB_Regex.Text.Trim();
    string strText=this.TB_Text.Text.Trim(); System.Text.RegularExpressions.Regex reg=new System.Text.RegularExpressions.Regex(strReg);
    Response.Write(reg.IsMatch(strText).ToString());
    }
    你可以自己测试一下,这也算不得什么超难吧
      

  5.   

    使用RegularExpressionValidator控件可以在代码中动态的设置它的ValidationExpression属性
      

  6.   

    是不错!但怎么设置它才能使其在除了输入串中没有 aaa(0)="小王",aaa(1)="小张"...
    这样一个数组呢?