import re
str = "The rain in Spain"
# 检查 "ain" 是否存在,但不在单词结尾处:
x = re.findall(r"ain\B", str)
print(x)
if (x):
print("Yes, there is at least one match!")
else:
print("No match")