Skip to content

Instantly share code, notes, and snippets.

@cristinelpopescu
Created April 19, 2021 12:43
Show Gist options
  • Save cristinelpopescu/999e9bda4ad1205e37f8733ef591060f to your computer and use it in GitHub Desktop.
Save cristinelpopescu/999e9bda4ad1205e37f8733ef591060f to your computer and use it in GitHub Desktop.
# Password checker
# At least 8 characters long
# Contain any sort of letters, numbers, @%$#
# Has to end with a number
import re
pattern = re.compile(r"([a-zA-Z]).([a])")
string = 'search inside of this text'
pattern2 = re.compile(r"[A-Za-z0-9#$%@]{8,}\d")
password = 'supersecret123@$0'
a = pattern.search(password)
check = pattern2.fullmatch(password)
print(check)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment