View Single Post
  #1 (permalink)  
Old 09-02-2006, 12:45
ledeanio ledeanio is offline
Member
 
Join Date: Nov 2005
Posts: 56
Default 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,
__________________
LD
------------------------------------------------------
Webmaster of DeanRichardson.Com
Web:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Forum:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

!!! AVE IT !!!
Reply With Quote