var s='abcd123'
var s='abcd'
var all=/^[a-z\d]+$/,char=/[a-z]/,num=/\d/
alert(all.test(s)&&char.test(s)&&num.test(s))
s='abcd123'
alert(all.test(s)&&char.test(s)&&num.test(s))var all=/^[a-z\d]+$/,char=/[a-z]/,num=/\d/
alert(all.test(s)&&char.test(s)&&num.test(s))
------解决方案--------------------
+1 版主牛b啊,不过为什么每行都木有分号呢,这个习惯... ------解决方案-------------------- var reg1 = /[\x61-\x7a\x41-\x5a]+[\x30-\x39]+/; // match a-z 61-7a A-Z 41-5a 0-9 30-39
var reg2 = /[\x30-\x39]+[\x61-\x7a\x41-\x5a]+/; // match 0-9 30-39 a-z 61-7a A-Z 41-5a
var a = "abc123", b = "abc";