立即学习:https://edu.csdn.net/course/play/26899/344221?utm_source=blogtoedu
1.提取
import re
ret=re.findall(【正则表达式】,【被提取的字符串】)
注:返回的类型是列表
2.import re
ret=re.match(【正则表达式】,【被匹配的字符串】)
注:如果匹配成功,返回返回<class 're.match'>对象
如果匹配不成功,返回none
3.替换
import re
ret=re.sub(【正则表达式】,【替换成的字符串】,【被匹配的字符串】)