运行 ❯
拥有你自己的 Python 服务器
×
更改方向
更改主题,深色/浅色
前往 Spaces
import re txt = "The rain in Spain" #Check if the string ends with "Spain": x = re.findall("Spain\Z", txt) print(x) if x: print("Yes, there is a match!") else: print("No match")
['西班牙']
是的,有匹配项!