This topic created in 5288 days ago, the information mentioned may be changed or developed.
要求支持整数或者浮点,指定小数点后的位数
^\d+(\.\d{1,2})?$
不知道为什么,这个表达式在一些正则表达式的测试工具里面提示正常,但是在firefox里面。总是不能正常运行,其他浏览器没有测试。
4 replies • 1970-01-01 08:00:00 +08:00
 |
|
1
altchen Apr 24, 2012
不能正常运行是指啥 试了下可以的,ff 11.0 <script> alert(/^\d+(\.\d{1,2})?$/.test('11.22')); </script>
|
 |
|
2
leben Apr 24, 2012
我测试11.11总是报false
|
 |
|
3
altchen Apr 24, 2012
擦,哪来的11.11 使用11.0升级提示最新了.. 要不你换回11.0试下
|