input password regex validation code example
Example 1: RegExp validation for password explained
r'^
(?=.*[A-Z]) // should contain at least one upper case
(?=.*[a-z]) // should contain at least one lower case
(?=.*?[0-9]) // should contain at least one digit
(?=.*?[!@#\$&*~]) // should contain at least one Special character
.{8,} // Must be at least 8 characters in length
$
Example 2: regex expression for password validation form validation
/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,15}$/