Got more questions? Find advice on: ASP | SQL | XML | Windows
in Search
Welcome to RegexAdvice Sign in | Join | Help

Yet Another Complex Password RegEx

Last post 07-03-2008, 9:17 AM by mash. 2 replies.
Sort Posts: Previous Next
  •  07-03-2008, 7:54 AM 43723

    Yet Another Complex Password RegEx

    I need some help with a RegEx.  I am using ColdFusion 8.  Ultimately, I need to validate new and changing passwords to meet The Enterprise's password complexity requirements.  I have two web forms - one for new users, and another for existing users to reset their passwords.  For both forms I will be using server-side validation on post.  I need a regular expression that validates according to the following rules:

    Passwords must be at least 7 characters and contains characters from 3 of the following four character type groups:
        Upper Case Letters: A B C...
        Lower Case Letters: a b c...
        Numbers: 1 2 3...
        Special Characters/Symbols: ` ~ ! @ ## $ % ^ & * ( ) _ + - = { } | \ : " ; ' < > ? , .

    I would like to use one regular expression to do this, but I'm not against writing CF logic to accomplish the same thing.  It seems like the 3 out of 4 bit would be pretty complex.  But for as much as I know about Regular Expressions, it might not be.

    Thanks so much for your help.

    -Jonathan

  •  07-03-2008, 7:58 AM 43724 in reply to 43723

    Re: Yet Another Complex Password RegEx

    Scratch the double ## special character.  Thst should just be #.
  •  07-03-2008, 9:17 AM 43725 in reply to 43723

    Re: Yet Another Complex Password RegEx

    See if you can adapt the patterns from this thread http://regexadvice.com/forums/thread/28417.aspx which addresses a very similar problem.

    Michael

    "In theory, theory and practice are the same. In practice, they are not."
    Albert Einstein
View as RSS news feed in XML