推荐几个学习地址:
http://blog.youkuaiyun.com/mu_rain/article/details/5435745
正则表达式的写法:
(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).{6,16}
js验证的写法:
function txtPassword_check()
{
var strPassword =document.getElementById("user_userpass").value;
var num=0;
if(strPassword.search(/[A-Z]/)!=-1)
{
num+=1;
}
if(strPassword.search(/[0-9]/)!=-1)
{
num+=1;
}
if(strPassword.search(/[a-z]/)!=-1)
{
num+=1;
}
if(strPassword.search(/[^A-Za-z0-9]/)!=-1)
{
num+=1;
}
if(num>=2 && (strPassword.length>=6 && strPassword.length<=16 ))
{
alert(“y”);
}
else
{
alert(“n”);
}