I am trying to implement a password validation requirement where a new password must be 6 characters in length and contain at least one letter and once number. I found a regex online at regexlibs that supposedly does this, but I can't get it to work. In fact, I can't get any complex regex's to work. Here's what I've got:
preg_match("(?=.[0-9]+.)(?=.[a-zA-Z]+.)[0-9a-zA-Z]{6,}$","passw0rd");
I am testing for results greater than 0, so this should pass the test.
What am I doing wrong?