forked from x4nth055/pythoncode-tutorials
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmatch.py
More file actions
Latest commit
8 lines (8 loc) · 328 Bytes
/
Copy pathmatch.py
File metadata and controls
8 lines (8 loc) · 328 Bytes
1
2
3
4
5
6
7
8
importre# stands for regular expression
# a regular expression for validating a password
match_regex=r"^(?=.*[0-9]).{8,}$"
# a list of example passwords
passwords= ["pwd", "password", "password1"]
forpwdinpasswords:
m=re.match(match_regex, pwd)
print(f"Password: {pwd}, validate password strength: {bool(m)}")