试图从文件中找到一组特定的Mac

发布于 2025-01-17 13:45:02 字数 295 浏览 1 评论 0原文

我一直在尝试从文件中找到一组特定的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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文