On Thu, 13 Dec 2001 14:36:38 +0100 Bart Lateur <[EMAIL PROTECTED]> wrote: > On Thu, 13 Dec 2001 14:29:14 +0100, Kim Schulz wrote: > > >How short kan you make a program (oneliner?) that: > > > >* checks if a password is 5 characters long or more > >* checks if the password contains at least 3 alpha chars (a-zA-Z) > >* checks if the password contains at least 2 numbers (0-9) > > If a password contains at least 3 letters and 2 digits, than it has to > be at least 5 character long. > > /^(?=.*\d.*\d)(?=.*[a-z].*[a-z].*[a-z])/i > > Short enough? >
Not exactly.. how about a password lige ab12345 ? it's more than 5 characters long, but only 2 of then are letters. This password shouldn't be accepted. later Kim Schulz