r/ProgrammingPrompts • u/normandantzig • Dec 06 '16
Strong Password Detection
Write a function that uses regular expressions to make sure the password string it is passed is strong. A strong password is defined as one that is at least eight characters long, contains both uppercase and lowercase characters, and has at least one digit. You may need to test the string against multiple regex patterns to validate its strength.
Source: AutomateTheBoringStuff
10
Upvotes
View all comments
Show parent comment
1
u/zebulan_ Dec 06 '16
I wrote this a while ago as a reply to a different thread about Automate the Boring Stuff. Not perfect but it could be a starting point for you.
Although practicing regular expressions may be the point of the exercise, you could also write it without regular expressions at all. Maybe use counts for different character sets (lowercase, uppercase, digits, punctuation, etc).