no_bao 发表于 2013-1-29 08:33:08

JS的正则表达式

JS的正则表达式 

//校验是否全由数字组成 

function isDigit(s) 

var patrn=/^{1,20}$/; 
if (!patrn.test(s)) return false 
return true 



//校验登录名:只能输入5-20个以字母开头、可带数字、“_”、“.”的字串 

<div class="dp-highlighter" style="background-color: #efefef; width: 766px; overflow: auto; margin-left: 9px; padding: 1px; text-align: left;"><div class="bar" style="font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Consolas, 'Courier New', monospace; line-height: 25px;"><div class="tools" style="padding: 3px; margin: 0px; font-weight: bold;">Java代码  http://www.iteye.com/images/icon_star.png
页: [1]
查看完整版本: JS的正则表达式