import re
#p='[a-z]+.com' # + 匹配1次或多次前面出现的正则表达式
#p='goo?' # ? 匹配0次或1次
#p='[0-9]{3}'
#p='[0-9]{5,9}'
p='[0-9]|[A-Za-z]'
str='c'
result = re.match(p,str)
if result is not None:
print(result.group())
python正则表达式
最新推荐文章于 2024-04-29 17:20:51 发布