运行 ❯
获得你
自己的 Python
服务器
×
改变方向
改变主题,浅/暗色
转到 Spaces
import re txt = "The rain in Spain" #Check if "ain" is present, but NOT at the end of a word: x = re.findall(r"ain\B", txt) print(x) if x: print("Yes, there is at least one match!") else: print("No match")
[]
无匹配项