On Mon, Feb 17, 2003 at 07:40:46PM -0000, Matt Groves wrote:
> I'm looking for the shortest, cleverest possible solution to this.  When
> changing a password, I need a RegExp which will ensure the following
> criteria :
> 
> 1. It must be at least 6 characters
> 
> 2. It must contain at least one lower case letter [a-z]
> 
> 3. It must contain at least one upper case letter [A-Z]
> 
> 4. It must contain at least one number [0-9]
> 
> 5. Optionally, it can cover for accepted non-alphanumeric chars such as
> "_", "-" etc (but not "#"), and a maximum password length of 14
> characters

If you insist on it beeing a single regexp, I would do it with several
lookahead assertions ;-)

print "ok" if /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[\w-]{6,14}$/

CU,
    Sec
-- 
Currently it is not possible, but it would be possible to write to code
to make this possible.

Reply via email to