,求购一个正则表达式,TextBox中不能输入有"'"符号的

解决方案 »

  1.   

    这样写:
    [^\']{0,500}
    其中500是TextBox的最大字符数,可根据情况进行修改。
      

  2.   

    直接拿“‘”去匹配不就可以吗string strPattern = "'";
    Regex regex = new Regex(strPattern);
    Match match = regex.Match(strInput);
      

  3.   

    ^[^']+$or simply<input type=text onpaste="return false;" 
    onkeypress=" if (event.keyCode == 39) event.keyCode = 0;">
      

  4.   

    <input type=text onpaste="return false;" 
    onkeypress=" if (event.keyCode == 39) event.keyCode = 0;">
    这种方法简单,不过,你要想限制别的符号,就需要记住所有的kiyCode
      

  5.   

    >>>不过,你要想限制别的符号,就需要记住所有的kiyCodethat is not true, you can also do<input type=text onpaste="return false;" 
    onkeypress=" if (/[$!']/.test(String.fromCharCode(event.keyCode))) event.keyCode = 0;">
      

  6.   

    以下是kellyhapyy和owenbeckham(kelly)二者(估计是同一个人)的游戏贴
    一般倒分贴,怎样也装装样子回答几句
    这位仁兄(kellyhapyy)是40分80分的给up者(owenbeckham(kelly))
    且kellyhapyy在论坛总共的帖子刨去点数为0和1,以及未结贴的
    不是倒分贴的竟然只有一个
    不知道这位老兄是不是程序员http://community.csdn.net/Expert/topic/3849/3849047.xml?temp=.4635431
    http://community.csdn.net/Expert/topic/3420/3420758.xml?temp=.387768
    http://community.csdn.net/Expert/topic/3399/3399142.xml?temp=.6510584
    http://community.csdn.net/Expert/topic/3376/3376092.xml?temp=.4210169
    http://community.csdn.net/Expert/topic/3195/3195118.xml?temp=.9808771