Created
December 6, 2022 19:39
-
-
Save ShahriyarR/30f587099224708511b3b8d8bd65709f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
def validate_password(password: str) -> bool: | |
reg = r"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*#?&])[A-Za-z\d@$!#%*?&]{6,20}$" | |
pattern = re.compile(reg) | |
return bool(re.search(pattern, password)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment