Looking for a regex - 8 char min w/ 1 num and 1 char -


I'm looking for some help in which a regex is required, for which 8 characters (at least) w / 1 number and 1

example: a1234567 is valid but 12345678 is not

Any help for a regex newb?

EDIT:

Thanks for the quick reply - The implementation that works in VB is shown below.

  Dim Valipesword Boolean = Regex. Ismail (password, "^ (? =. *. [[0-9]] (=? =. * [A-ja-jade]) \ w {8,} $")  

something like

  ^ (? =. * [0-9]) ( <= P> 

> ^ beginning of the string

  • (? =. * [0-9]) look forward and ensure that at least 1 digit
  • (? =? * [A -ZA-Z]) look forward and make sure there is at least 1 letter
  • \ w { 8,} actually match 8+ characters
  • $ n
  • no Agree: If you want extra characters (which do not count for 1 letter required)

      ^ (? =. * [0-9]) (? =? . * [A-zA-Z]). {8,} $  

    This will allow for any character

    If you want permission of only a few characters , Then replace \ w with the code in the first code [A-Za-z0- 9 # #%%] ^ & Amp; with your symbols choice

    ^ (?! [0- 9] $) (?! [A-zA-Z _] $) \ W {8,} $


    Comments

    Popular posts from this blog

    c++ - Linux and clipboard -

    What is expire header and how to achive them in ASP.NET and PHP? -

    sql server - How can I determine which of my SQL 2005 statistics are unused? -