python正则(匹配任意位置中间)文本字符串内容
# -*- coding: UTF-8 -*- import re txt='@font-face{font-family:"capplition/font-woff;charset=utf-8;basK0Vmv==)' bs64_str = re.findall("charset=(.*?);basK0Vmv", txt)[0] print(bs64_str) utf-8
# -*- coding: UTF-8 -*- import re txt='@font-face{font-family:"capplition/font-woff;charset=utf-8;basK0Vmv==)' bs64_str = re.findall("charset=(.*?);basK0Vmv", txt)[0] print(bs64_str) utf-8