使用正则表达式在字符串中多次拆分(multiple split in string using regex)
我有一个字符串:
Station Disconnect:1.3.6.1.4.1.11.2.14.11.15.2.75.3.2.0.8 StaMAC:00:9F:0B:00:38:B8 BSSID:00 9F Radioid:2我想拆分这个字符串。 它看起来像这样 -
'Station Disconnect:1.3.6.1.4.1.11.2.14.11.15.2.75.3.2.0.8' 'StaMAC:00:9F:0B:00:38:B8' 'BSSID:00 9F' 'Radioid:2'我尝试了这个逻辑 - msgRegex = re.compile('[\ w \ s] +:')和split函数。 我该怎么办请帮帮我谢谢
I have a string :
Station Disconnect:1.3.6.1.4.1.11.2.14.11.15.2.75.3.2.0.8 StaMAC:00:9F:0B:00:38:B8 BSSID:00 9F Radioid:2I want split this string. It look like this -
'Station Disconnect:1.3.6.1.4.1.11.2.14.11.15.2.75.3.2.0.8' 'StaMAC:00:9F:0B:00:38:B8' 'BSSID:00 9F' 'Radioid:2'I tried this logic - msgRegex = re.compile('[\w\s]+:') and split function also. How can I do Please help me Thank you
更多推荐
发布评论