Perl Regular Expressions for Password Checking

OK... I admit it... I'm a "regular expression" ignoramus.  

I'm enforcing passwords of at least 6 characters in length, with at least 1 uppercase letter, 1 lowercase letter, and at least 1 number.  How do I construct a regular expression that checks that?
eDistrictAsked:
Who is Participating?
 
Kim RyanIT ConsultantCommented:
Just chain togethor a regexp for each condition you need
my $pwd = '12A45b';

if ( $pwd =~ /\w{6,}/ and $pwd =~ /\d/ and $pwd =~ /[A-Z]/ and $pwd =~ /[a-z]/ )
{
    # password is valid
}
else
{
    #re enter password
}
0
 
eDistrictAuthor Commented:
Thank you very much!  :)   I've GOT to break down and learn regexp's... :::sigh:::
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.