import re #email = re.compile(r'([A-Za-z0-9]+[.-_])*[A-Za-z0-9]+@[A-Za-z0-9-]+(\.[A-Z|a-z]{2,})+') #target = "hamedmehdi.official@protonmail.com" #invalid = "hamedmehdi.official.com" #if re.fullmatch(email, invalid) : # print("email is valid") #else : # print("invalid email address") ########################################## #s = "python for red-blue teams" #if re.search("red", s) : # print("match") #else: # print("no match") #txt = "hacking the hacker is one of the best hacking experience" #pattern = re.findall("hack", txt) #print(pattern) #[] -> [c-h] #. -> any character -> "py..n" #^ -> "^hello" #$ -> "teams$" #* -> "py.*n" #+ ? {} | #[arm] #[a-n] #[^arm] #[0123] #[0-9] #[a-zA-Z] #hamedmehdi.official@protonmail.com