其实
只要满足:float就可以了
我在http://www.regexplib.com/DisplayPatterns.aspx?cattabindex=2&categoryId=3
查到一个:
Expression:  (^\d*\.?\d*[1-9]+\d*$)|(^[1-9]+\d*\.\d*$)
    
Description:   Accepts only positive decimal values. Zero and negatvie numbers are non-matching. Allows zeros after last non-zero numeric value after decimal place for significant digits.  
Matches:  [0.050], [5.0000], [5000]  [ More Details]  
Non-Matches:  [0], [0.0], [.0]  
不能验证科学记数法,如1.234+e9

解决方案 »

  1.   

    Regex rg=new Regex(@"^(\d+(.\d+)?|\d(.\d+)?\+[eE]\d+)$");
    Response.Write(rg.IsMatch(TextBox1.Text));
      

  2.   

    这个没问题
    Regex rg=new Regex(@"^(\d+(\.\d+)?|\d(\.\d+)?\+[eE]\d+)$");
    Response.Write(rg.IsMatch(TextBox1.Text));
      

  3.   

    试试这个:^\d+(?:\.\d+)?(?:\+|-[e|E]\d+)?$
      

  4.   

    wyfwyf2000(讨分-多多益善)和storm2003(storm) 的方法可以验证float型数据,
    但是不能验证用科学记数法表示的数据。
    zjsen(星愿)(个人观点,仅供参考.请自行验证) 的方法虽然可以验证,但是没有排除负数的情况其实我想验证的就是如下几种:
    能匹配:
    1235 
    12.035
    0.025
    12.00
    1.234+e9
    小数点后可以有不定个0
    但是小数点前面若是第一位置为0,则不能多于两个0
    即00.123不匹配
    1.2340+e9也不能匹配。请各位大虾多多帮忙
    我再加点分。
      

  5.   

    ^\d+((?:\.\d+)|(?:\.\d+(\+|-)[e|E]\d+))?$能匹配:
    1235 
    12.035
    0.025
    12.00
    1.234+e9
    1.2340+E9    这也是科学记数法呀
    123.0+e3     同上
    00.123       多个零没关系吧,一时找不到方法不匹配的
    1234.    error
    1234+e3  error
    1234e3   error
    123.e+3    error
    1.234+e9+e3   error
    1.234+e9e3    error
    ......
      

  6.   

    麻烦storm2003(storm)再想想办法,解决一下 00.123 匹配
      

  7.   

    to winwang168(无名):
    1,浮点数
    ([0-9]*\.[0-9]+)|([0-9]*)
    能匹配形如:00.89 (要求不能匹配)    , 但不能匹配:  1.2+e7 (要求能匹配)
      

  8.   

    ^((?:[0])|(?:[1-9]\d*))((?:\.\d+)|(?:\.\d+(\+|-)[e|E]\d+))?$storm2003(storm) 那里改来的