0
Metacharacters
import re pattern = r"[A-Za-z][A-Za-z][0-9]" if re.search(pattern, "LS8"): print("Match 1") if re.search(pattern, "YE45"): print("Match 2") if re.search(pattern, "la9"): print("Match 3") All the codes are a match according to my output. I thought "Match 2 was not valid per the criteria i.e two alphabets and a digit. Why is it a match please
2 odpowiedzi
+ 3
Because it matches YE4 in YE45.
0
Thanks