PHP Advanced Password Validation using Regular Expressions
Hi all,
I am having trouble validating passwords which users choose for
themselves. The rules I need to follow are:
Has to be between 7 - 20 chars
Must only contain a-z A-Z 0-9
Must have at least one lowercase, one uppercase and one digit in this.
The validation I am running at the moment is:
if (!ereg("([a-z]{1,}[A-Z]{1,}[0-9]{1,})",$password))
{
$patternmatch='Problem';
}
But this doesn't look right. Could anyone please help?
Many Thanks,
|