> > >Must match 3 out of 4 rules
Must much at least 3 out of 4 rules I would
imagine, the more oblique the password the
better.
> > >1) Contain 1 or more Uppercase char
> > >2) Contain 1 or more Lowercase char
> > >3) Contain 1 or more numeric
> > >4) Contain 1 or more punctuation
> looking for 1 regex statement and perlre is the
> standard I think,
looking for 1 regex in this case is a bad thing to do.
the simple and smart thing to do is to match all
the four cases returning 1 or 0 for each
one and then say
# check supplied password matches at least 3
# of the criteria
if ($matchUpper + $matchLower + $matchNumeric +
$matchPunct >= 3) {
# new password OK
} else {
# new password bad, don't accept
}
Doing stuff in one confusing regex might look smart
but keeping things simple and transparent is
considerably smarter and more valuable.
###
Some people, when confronted with a problem, think �I
know, I�ll use regular expressions.� Now they have two
problems.
--Jamie Zawinski, in comp.lang.emacs
###
Stuart.
Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html