Password strength script failed
<p>I'm using a little script to check the password strength in an inscription form, here is a relevant part of the script:</p>

<pre><code>    $('#password').keyup(function(){

    var password = $(this).val();
    password = $.trim(password);

    var lettre_min = /[a-z]/;
    var lettre_maj =/[A-Z]/;
    var nombre = /[0-9]/;
    var symbole = /[\`\!\"\?\$\%\^\&amp;\*\(\)\_\-\+\=\{\[\}\]\:\;\@\'\~\#\|\\\&lt;\,\&gt;\.\/]/;

    if(password.length != 0)
    {   
        //password moin de 8 caractères
        if(password.length &lt;8)
        {
            $('.bar').animate({width:'50px',height:'5px'},200).show();
            $('.bar').css('background-color','red');
            $('.error').text('Too short').show();
        }else

        //password faible
        if((password.match(lettre_min)) &amp;&amp; password.length &lt;12)
        {
            $('.bar').animate({width:'75px',height:'5px'},200).show();
            $('.bar').css('background-color','red');
            $('.error').text('Weak').show();
        }else

        //password moyen
        //1 type
        if((password.match(lettre_min)) &amp;&amp; (password.match(nombre)) &amp;&amp; password.length &lt;12)
        {
            $('.bar').animate({width:'100px',height:'5px'},200).show();
            $('.bar').css('background-color','orange');
            $('.error').text('Average').show();
        }else ...
</code></pre>

<p>The problem is: if I put letters (lettre_min) AND numbers (nombre) on the form input, he tells me the password is weak when he should tell me that it is average. He totally ignores the second condition.</p>

<p>I have no clue what's going on =/</p>

<p>PS: I'm sorry if there is already an answer for this in an other question but I don't even know what the problem is, so I don't know what to search for =/</p>
