日期:2014-05-18  浏览次数:20622 次

寻找 正则表达式高手!
谁能帮我写一个正则表达式
验证:刻度为0.25的浮点数

寻求高手帮忙解决一下
我搞了一天了   都没搞出来
郁闷撒~

------解决方案--------------------
<html>
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=GBK ">
<title> check </title>
</head>

<body>

<input type= "text " name= "onenum " id= "onenum ">
<input type= "button " value= "check " onclick= "check(document.getElementById( 'onenum ').value) ">

</body>

<script>
function check(num){
var re = /^\d+(\.(0|25|5|75)0*)?$/g;
alert(re.test(num));
}
</script>
</html>

我这儿好像没什么错误啊

你输入哪个数不对?
------解决方案--------------------
哪个不匹配,你写出来看看,可能没考虑到.