标签:return 正则匹配 正则 pre string div mat com compile
import re u = "http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+" def match_by_re(str): pattern = re.compile(u, re.S) res = pattern.findall(string=str) if res: return res[0]
标签:return 正则匹配 正则 pre string div mat com compile
原文地址:https://www.cnblogs.com/li1992/p/10438208.html