主页
Python
Python 正则表达式
demo_regex_search
运行 ❯
×
更改方向
保存代码
更改主题
import re txt = "The rain in Spain" x = re.search("\s", txt) print("The first white-space character is located in position:", x.start())
The first white-space character is located in position: 3