evco
asked on
PHP Password RegEx
Hi,
I'm trying to produce a regex for a password with the following requirements:
Min. 8 characers with at least two digits/numbers
Two or more numbers anywhere in a string...how does that translate to a regex?
(?=.*/d) is at least one number, but I cannot figure out how to do at least two numbers.
Thanks!
I'm trying to produce a regex for a password with the following requirements:
Min. 8 characers with at least two digits/numbers
Two or more numbers anywhere in a string...how does that translate to a regex?
(?=.*/d) is at least one number, but I cannot figure out how to do at least two numbers.
Thanks!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I'm using the PEAR QuickForm class and passing a regex to validate the password field. Obviously, I can work around that and use the strlen() function.
Thanks all, for your help.
Thanks all, for your help.
If you can pass two regexs to the validation thing, you can also do this:
/.{8,}/
That will specify that there are 8 chars or more.
/.{8,}/
That will specify that there are 8 chars or more.
ASKER
:) Thanks, jk2001
ASKER