import re #正则表达式模块
data=‘Python is the best language in the world’
result=re.match(‘P’,data) #精确匹配 从起始位置匹配
print(type(result)) #返回<class ‘re.Match’>
print(result.group()) #获取匹配结果
import re #正则表达式模块
data=‘Python is the best language in the world’
result=re.match(‘P’,data) #精确匹配 从起始位置匹配
print(type(result)) #返回<class ‘re.Match’>
print(result.group()) #获取匹配结果