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:
Can you please help construct the regular expression needed to validate the above?
try this regex here:
((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%]).{8,40})
( # Start of group
(?=.*\d) # must contains one digit from 0-9
(?=.*[a-z]) # must contains one lowercase characters
(?=.*[A-Z]) # must contains one uppercase characters
(?=.*[@#$%]) # must contains one special symbols in the list "@#$%"
. # match anything with previous condition checking
{8,40} # length at least 8 characters and maximum of 40
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With