摘要: //校验是否全由数字组成 [code] function isDigit(s) { var patrn=/^[0-9]{1,20}$/; if (!patrn.exec(s)) return false return true } [/code] //校验登录名:只能输入5-20个以字母开头、可带数字、“_”、“.”的字串 [code] function isRegisterUserName(s)... 阅读全文
posted @ 2008-11-10 09:08 s80895304 阅读(198) 评论(0) 推荐(0) 编辑
摘要: JavaScript--正则表达式 正则表达式(regular expression)对象包含一个正则表达式模式(pattern)。它具有用正则表达式模式去匹 配或代替一个串(string)中特定字符(或字符集合)的属性(properties)和方法(methods)。 正则表达式构造函数: new RegExp("pattern"[,"flags"]); 参数说明: pattern --... 阅读全文
posted @ 2008-11-10 09:00 s80895304 阅读(180) 评论(0) 推荐(0) 编辑