####匹配字段 defmatch_field(txt): iftxt!='': result={} data=txt.split('|') fortmpindata: m=re.match("(.*)=(.*)",tmp) ifm!=None: #printm.group() ifm.group(1)=='usermac': result['usermac']=m.group(2)[0:17] else: result[m.group(1)]=m.group(2) returnresult
####匹配字段 defmatch_field(txt): iftxt!='': result={} data=txt.split('|') fortmpindata: m=re.match("(.*)=(.*)",tmp) ifm!=None: #printm.group() ifm.group(1)=='usermac': result['usermac']=m.group(2)[0:17] else: result[m.group(1)]=m.group(2) returnresult