gpt4 book ai didi

regex - MAC 地址的正则表达式是什么?

转载 作者:行者123 更新时间:2023-12-03 04:35:54 25 4
gpt4 key购买 nike

采用这种格式:

3D:F2:C9:A6:B3:4F

或者:

3D-F2-C9-A6-B3-4F

最佳答案

The standard (IEEE 802) format for printing MAC-48 addresses in human-friendly form is six groups of two hexadecimal digits, separated by hyphens - or colons :.

所以:

^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$

关于regex - MAC 地址的正则表达式是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4260467/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com