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

Password Validation Pattern

  •  01-15-2009, 11:32 AM

    Password Validation Pattern

    Hello,

    I need help!

    I got this password validation expression (?=.{6,})(?=(.*\d){1,})(?=(.*\W){1,}) and should add additional "rule".
    The rules in this expression are: the pwd has to be at least 6 chars long, contain at least one digit and contain at least one special character.
    The "rule" or expression I should add, should prevent typing in combinations like this "aaa" or "222" - any repetitions of letters or numbers if there are over 2 chars or numbers repetitions.

    I tried (?!((?<dp>\w)\k<dp>{2,})) but it does not work. I tried several variations and ... Apparently I don't get it. Please help!
    (I used named group "dp" just to make clear where my back reference \k<dp> is looking at.)

    The platform: Microsoft.NET Framework 3.5
    Programming Language: C#
    RegEx options: Compiled, Ignore Case, Ignore White, Singleline, Culture Invariant.


View Complete Thread