请教一个关于re.compile多重匹配的问题
import re
s = ‘Condiction=BTFreqSweep tech=BT;subtc=Power stage=After_Cal;ant=1;rate=4-DH1;cc=2;pCap=4;freq=2402’
p = re.compile(r”Condiction=(\w+)ant=(\d+)rate=(\w)freq=(\d+)”)
priint(p.findall(s))
我想匹配出下面的格式应该怎么写,求帮助, 谢谢 !!!
[‘BTFreqSweep’, ‘1’, ‘4-DH1’, ‘2402’]
Try this