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

help in writing Regex

Last post 05-09-2008, 1:57 PM by ddrudik. 4 replies.
Sort Posts: Previous Next
  •  05-06-2008, 8:37 PM 41969

    help in writing Regex

    Hi,

    I need a regex to validate a password field. The password should be minimum 8 Characters in length and maximum of 15 Characters, with at least one English alphabet (upper or lower case), at least one digit (0 - 9), and at least one Symbol ( special character ).

    I am working on C#, .NET platform

    Any help will be appreciated.

     

    Thanks 

     

  •  05-06-2008, 11:08 PM 41972 in reply to 41969

    Re: help in writing Regex

    Can I suggest a quick search of this forum with the 'password' search string - it turned up quite a few hits when I tried it just now.

    There have been a number of questions along this line over the past few months, with varying requirements, and a number of potential solutions. I would suggest that you have a look at these and then get back to us if none of these suit your needs and where they are failing. In that way we can address the specific issues you are having.

    Susan 

  •  05-07-2008, 9:24 AM 41984 in reply to 41972

    Re: help in writing Regex

    Thanks Susan.

    Will get back if I could not find a suitable regex. 

  •  05-09-2008, 1:00 PM 42086 in reply to 41984

    Re: help in writing Regex

    Hi

    I could find a regular expression that meets the following requirements:

    Mimimum 8 Characters with at least one English alphabet (upper or lower case), at least one digit and at least one symbol. (?=.*\d)(?=.*[A-Za-z])(?=.*[!@#$%^&*_+=’:;,.()-]).{8,}$.

    It works fine in firefox but does not work in IE7 browser.

    Can you please help me out with this.

     

    Thanks 

     

  •  05-09-2008, 1:57 PM 42087 in reply to 42086

    Re: help in writing Regex

    There's a bug in the client-side MS regex engine.  Try reordering so that the length check is first.:

    (?=.{8,})(?=.*\d)(?=.*[A-Za-z])(?=.*[!@#$%^&*_+=’:;,.()-])


View as RSS news feed in XML