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

help regarding regular expression

Last post 07-01-2008, 10:32 AM by ddrudik. 2 replies.
Sort Posts: Previous Next
  •  07-01-2008, 7:53 AM 43652

    help regarding regular expression

    hi forum...

    i am in bad need to find out a regular expression... pls help

    condition is regular expression is for password validation

    conditions:

    o    6 or more characters with mix of any 2 below

    §  Upper case

    §  Lower case

    §  Number

    §  Special character

     

  •  07-01-2008, 10:01 AM 43659 in reply to 43652

    Re: help regarding regular expression

    I can't figure out a simpler solution

    (?x-i)(?=
                 (?:
                     ([A-Z])|([a-z])|(\d)|(\W)
                  )
                 (?(1)(?=.*(?:(?2)|(?3)|(?4))))
                 (?(2)(?=.*(?:(?1)|(?3)|(?4))))
                 (?(3)(?=.*(?:(?1)|(?2)|(?4))))
                 (?(4)(?=.*(?:(?1)|(?2)|(?3))))
    ).{6,}

     

  •  07-01-2008, 10:32 AM 43664 in reply to 43659

    Re: help regarding regular expression

    I can't say this is any simpler but here's one I used:

    (?=.{6})(?:(?=.*[A-Z])(?=.*[a-z])|(?=.*[A-Z])(?=.*\d)|(?=.*[A-Z])(?=.*[^A-Za-z\d])|(?=.*[a-z])(?=.*\d)|(?=.*[a-z])(?=.*[^A-Za-z\d])|(?=.*\d)(?=.*[^A-Za-z\d])).*


View as RSS news feed in XML