You need to write regex that will validate a password to make sure it meets the follwing criteria:
function validate(password) { return /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])[a-zA-Z0-9]{6,}$/.test(password); }
原文:http://www.cnblogs.com/bldf/p/6351509.html