I wrote a lengthy function, same like .ColBeseder .added a type checking :Dstring
function check( str ){ var lengthMoreThanFour = false, hasOneLower = false, hasOneUpper = false, return ( typeof str hasOneDigit== ='string') false;&& lengthMoreThanFour = ( str.length >>= 4 ); for( var i =0; i<str.length ; i++ ){ && if ( !hasOneLower && /[a-z]/.test( str[i])str ){ hasOneLower = true; }&& if ( !hasOneUpper && /[A-Z]/.test( str[i])str ){ hasOneUpper = true; && } if ( !hasOneDigit && /[0-9]/.test( str[i])str ){ hasOneDigit = true; } } return lengthMoreThanFour && hasOneLower && hasOneUpper && hasOneDigit } and call its as check('AAA1a') , which returns a boolean