这对我有用:
# get all the itemsmatches = re.findall(r'w+=".+?"', s) + re.findall(r'w+=[d.]+',s)# partition each match at '='matches = [m.group().split('=', 1) for m in matches]# use results to make a dictd = dict(matches)
这对我有用:
# get all the itemsmatches = re.findall(r'w+=".+?"', s) + re.findall(r'w+=[d.]+',s)# partition each match at '='matches = [m.group().split('=', 1) for m in matches]# use results to make a dictd = dict(matches)