I need a regex to test user password for:
Less There should be no less than 8 characters alphanumeric format, no more than 4 consecutive numbers, no id in the password (i.e. it can not be used: I Any help would be great! If you want to solve it with regex, then just add a negative lookahead assertion. You can test it added part Why would you like to limit the password for 15 characters? I removed it in my example. 1234 ,
9876 , < Code> abcd , or
1234abvc )
^ ([a-zA-Z0- 9! @ # $ *%] {815) }) $ currently and it works great, but felt There is no account for a string of string letters. I'm not sure how to add a mixture.
^ (?!. * \ D {4,}. *) ([A-zA-Z0- 9! @ # $ *%] {8, }) $
(?!. * \ D {4,}. *) does not consume your string, it only checks Whether 4 or more numbers in a row and if so, its false.
Comments
Post a Comment