万物皆可findall
import re
c1 = "XBV472150,黑色"
c2 = "['DF193408-15刚质韵黑']"
d1 = re.findall(".*?skuText.*?text.*?:\"(.+?),.*?\",", b1[0])[0]
d2 = re.findall("skuText.*?([A-Z].*?\d)[\u4e00-\u9fa5].+", b2[0])[0]
>>>
XBV472150
DF193408-15
万物皆可findall
import re
c1 = "XBV472150,黑色"
c2 = "['DF193408-15刚质韵黑']"
d1 = re.findall(".*?skuText.*?text.*?:\"(.+?),.*?\",", b1[0])[0]
d2 = re.findall("skuText.*?([A-Z].*?\d)[\u4e00-\u9fa5].+", b2[0])[0]
>>>
XBV472150
DF193408-15
本文标题:python中的正则使用
本文链接:https://www.haomeiwen.com/subject/ygmurltx.html
网友评论