match vs search
re.match() checks at the start of the string only. re.search() scans the entire string for the first match.
re.match() checks at the start of the string only. re.search() scans the entire string for the first match.
import re
text = "Hello World"
print(re.match(r"World", text)) # None (not at start)
print(re.search(r"World", text)) # match object
Use re.search() when you do not know where in the string the match occurs.