AWS Cognito Password Regex
Let your users know if they meet your password requirements
If you are using AWS Cognito there will come a time when you require a regular expression to check that users meet your password strength requirements

Solution
/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[\^$*.\[\]{}\(\)?\-“!@#%&/,><\’:;|_~`])\S{8,99}$/
That regex covers the default case where all boxes are selected. If you want to adjust the selection see the explanation below on how to make it work for your use-case.
Explanation
/
Indicates the start of a regular expression^
Beginning. Matches the beginning of the string.(?=.*[a-z])
Requires lowercase letters(?=.*[A-Z])
Requires uppercase letters(?=.*[0-9])
Requires numbers(?=.*[\^$*.\[\]{}\(\)?\-“!@#%&/,><\’:;|_~`])
Requires special characters (only the special characters listed by AWS Cognito).\S
Whitespace (space, tab, carriage return) not allowed{8,99}
Minimum 8 characters, maximum 99 characters$
End. Matches the end of the string./
Close.