我用控件<asp:RegularExpressionValidator id="RegularExpressionValidator1" runat="server" ControlToValidate="bybnTxt" ValidationExpression="^[0-9]+(.[0-9]{1,3})?$"
Display="Static" Font-Name="verdana" Font-Size="10pt" EnableClientScript="False">只能输入有两位小数的实数
</asp:RegularExpressionValidator>这样只能输入两位的正实数,但是有负数的情况步知道怎么办。
比如:-98.88  就不能输入进去了 
求正则表达式,能输入两位小数的实数!
太紧急了,求救!

解决方案 »

  1.   

    TO;xrascal(横刀夺爱)正则怎么才能学好啊。你是看的什么书籍了。
      

  2.   

    Thinking(c#)    高级QQ群6026787.    欢迎大家加入.  验证码:csdn.
      

  3.   


     不要给我分了 只用在百事创意大赛上
    http://jay.pepsi.163.com/article.jsp?id=16255
    点击"我也要帮他评分" 用163邮箱登陆 给我评分
    我还差几票 public static bool IfHankaku(string CheckInput)
    {
    //单字符
    string chrCheck = ""; for(int i=0;i<CheckInput.Length;i++)
    {
    chrCheck=CheckInput[i].ToString(); if (CHECK_HANKAKU.IndexOf(chrCheck)<0)
    {
    return false;
    }
    } return true;
    }我只给了大概意思! 希望帮我投票
      

  4.   

    ^-\d+(\.\d+)?$正则表达式,由浅入深学习:
    http://www.regexlab.com/zh/regref.htm