function isValidPassword(str){
if (!/^\w{6,20}/.test(str)){return false}
if (/^[A-Z]{6,20}$/.test(str)){return false}
if (/^[a-z]{6,20}$/.test(str)){return false}
if (/^_{6,20}$/.test(str)){return false}
return true
}
7.写一个正则表达式,得到如下字符串里所有的颜色
var re = /*正则...*/
var subj = "color: #121212; background-color: #AA00ef; width: 12px; bad-colors: f#fddee "
console.log( subj.match(re) ) // ['#121212', '#AA00ef']
var re =/#[0-9a-fA-F]{6}(?=;)/g;
var subj = "color: #121212; background-color: #AA00ef; width: 12px; bad-colors: f#fddee ";
console.log( subj.match(re) ) // ['#121212', '#AA00ef']