I am trying to implement the enforcement of password complexity through regular expressions on both client (JavaScript) and server side (ASP.NET C#).
The rules are the following:
- Must be 8-40 characters
- Must contain at least one digit
- Must contain at least one lowercase letter
- Must contain at least one uppercase letter
- Must contain at least one special character
Can you please help construct the regular expression needed to validate the above?
See Question&Answers more detail:os