首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

寻找 正则表达式高手!该怎么处理

2012-01-16 
寻找 正则表达式高手!谁能帮我写一个正则表达式验证:刻度为0.25的浮点数寻求高手帮忙解决一下我搞了一天了

寻找 正则表达式高手!
谁能帮我写一个正则表达式
验证:刻度为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>

我这儿好像没什么错误啊

你输入哪个数不对?
[解决办法]
哪个不匹配,你写出来看看,可能没考虑到.

热点排行