You are viewing a single comment's thread. Return to all comments →
This is a great solution!
You can simplify it further by changing
[!@#$%^&*()-+] to \W+ which is the regex for Any Non-alphanumeric character
So you would have...
count = 0 cases = [r'[a-z]', r'[A-Z]', r'[\d]', r'\W+'] for case in cases: if not re.search(case, password): count += 1 return max(count, 6 - n)
Seems like cookies are disabled on this browser, please enable them to open this website
Strong Password
You are viewing a single comment's thread. Return to all comments →
This is a great solution!
You can simplify it further by changing
[!@#$%^&*()-+] to \W+ which is the regex for Any Non-alphanumeric character
So you would have...