参考自:https://cloud.tencent.com/developer/article/1490616(题目来源)
所有题目
正则表达式
88.使用正则表达式匹配出<html><h1>www.baidu.com</h1></html>
中的地址
import re
text='<html><h1>www.baidu.com</html>'
f=re.compile(r'www\..+\.com')
f.findall(text)
a=“张明 98 分”,用 re.sub,将 98 替换为 100