In the following code, I expect the program to print "Match", because "\D+\d"
matches the "x4"
part of the string. But it does not print anything. What is the problem?
import re
pattern = r"\D+\d"
if re.match(pattern, "1x4"):
print("Match");
Thanks