regular expression newbie
I am verifying a supplied password to make sure it contains
at least one capital letter
at least one numeric
at least one special character (!@#$%^&*+)
is at least 8 characters
Here's the function I'm using currently.
var password = $('#password').val();
var re = new RegExp("!@#$%^&*");
alert("No special characters");
re = new RegExp("0123456789");
This is just test code so please don't comment on how bad it is, I'm trying to get it to work before I make it pretty.
Right now, no matter what I type the code is saying that the password contains no numbers and no special characters.
Clearly I'm doing something wrong, but what is it?
Can anyone point me in the right direction? Thanks.