I would love some help with a regular expression that tests a string for a few things.
I need the user to enter a value that is at least 10 characters in length, contains at least 1 number, at least 1 special character, and at least 1 upper case letter.
Any help would be greatly appreciated.
Thanks!
Just have a separate regex for each of the constraints:
.{10,},[0-9],[^0-9a-zA-Z][A-Z]And make sure that the string matches all of these regexes.
If you really need it, you can combine them all in one regex, using lookahead assertions:
(?=.*[0-9])(?=.*[^0-9a-zA-Z])(?=.*[A-Z]).{10,}