摘要: #encoding: utf-8import re#1.*:可以匹配0或者任意多个字符text = '0731'ret = re.match('\d*',text)print(ret.group())#2.+: 匹配一个或者多个字符text = '0731'ret = re.match('\d+', 阅读全文
posted @ 2019-03-21 09:24 还差得远*呢 阅读(127) 评论(0) 推荐(0)
摘要: #encoding: utf-8import re#1.匹配某个字符串text = 'hello'ret = re.match('he',text)#match只能从开始匹配,若开始未匹配到,则会报错print(ret.group())#2.点:匹配任意的字符text = 'hello'ret = 阅读全文
posted @ 2019-03-21 09:09 还差得远*呢 阅读(242) 评论(0) 推荐(0)