I have a form that asks for a password and I want to validate if the password has at least eight characters, and of these eight characters at least two must be numbers and two must be letters in any order. I'm trying with this:

```
    function validatePassword():void
    {
            var passVal:String = pass.text;
            if(validPass(passVal))
            {
                 trace("Password Ok");
                 sendForm();
            }
            else
            {
                 trace("You have entered an invalid password");
            }
            function validPass(passVal:String):Boolean{
                 var pw:RegExp = /^?=.{8,}[A-Za-z]{2,}[0-9]{2,}/;
                 return(pw.test(passVal));
            } 
     }

```

But it doesn't work. What I'm doing wrong?

Any help would be really appreciated!