probably want to write a script to write the regex :)

10 points for the first code snippit that generates it !!!



On 04/08/2004, at 3:43 PM, Alexander Samad wrote:

On Wed, Aug 04, 2004 at 02:52:28PM +1000, Stuart Cooper wrote:

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.

True but this is to be placed into a 4rd party program with no access to
code! so has to be a regex



### 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

-- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to