试图从文件中找到一组特定的Mac
我一直在尝试从文件中找到一组特定的MAC地址。 MAC基本上以34:d2:62的速度开始,并以随机排列的数字开始。这是我想到的,但这是不正确的:
results = re.compile(r'34:D2:62\.[0-9A-Fa-f]{2}\.[0-9A-Fa-f]{2}\.[0-9A-Fa-f]{2}')
MAC=re.findall(results,string)
基本上,我想找到类型的所有Mac:34:d2:62:..:..:..这是很多麻烦!我觉得我距离正确的答案只有一英里... 任何帮助将不胜感激
I have been trying to find a specific set of MAC addresses from a file. Basically the MAC starts with 34:D2:62 and continuous with a random arrangement of numbers. This is what I have come up with but it is incorrect:
results = re.compile(r'34:D2:62\.[0-9A-Fa-f]{2}\.[0-9A-Fa-f]{2}\.[0-9A-Fa-f]{2}')
MAC=re.findall(results,string)
Basically I want to find all the MACs that are of the type: 34:D2:62:..:..:.. I am still figuring out the re package and it has been quite some trouble! I feel like I am a mile away from the right answer...
Any help would be appreciated
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论