比如:
00-0B-2F-02-37-C8
00-E0-4C-77-B1-B6
从网上找到一个
^(?:(?'1'[0-9a-fA-F]{2})(?:\:)(?'2'[0-9a-fA-F]{2})(?:\:)(?'3'[0-9a-fA-F]{2})(?:\:)(?'4'[0-9a-fA-F]{2})(?:\:)(?'5'[0-9a-fA-F]{2})(?:\:)(?'6'[0-9a-fA-F]{2}))$|^(?:(?'1'[0-9a-fA-F]{2})(?:\-)(?'2'[0-9a-fA-F]{2})(?:\-)(?'3'[0-9a-fA-F]{2})(?:\-)(?'4'[0-9a-fA-F]{2})(?:\-)(?'5'[0-9a-fA-F]{2})(?:\-)(?'6'[0-9a-fA-F]{2}))$
发现不起作用
先谢谢了
4 个解决方案
#1
Mac地址以空格,"-",":"分开
^([0-9a-fA-F]{2})(([0-9a-fA-F]{2}){5})$
^([0-9a-fA-F]{2})(([0-9a-fA-F]{2}){5})$
#2
MAC地址 正则表达式
^([0-9a-fA-F]{2})(([/\s:-][0-9a-fA-F]{2}){5})$
Mac地址以空格,"-",":"分开
^([0-9a-fA-F]{2})(([0-9a-fA-F]{2}){5})$
中间没有任何符号
^([0-9a-fA-F]{2})(([/\s:-][0-9a-fA-F]{2}){5})$
Mac地址以空格,"-",":"分开
^([0-9a-fA-F]{2})(([0-9a-fA-F]{2}){5})$
中间没有任何符号
#3
正解。
#4
正解,实践证明的
#1
Mac地址以空格,"-",":"分开
^([0-9a-fA-F]{2})(([0-9a-fA-F]{2}){5})$
^([0-9a-fA-F]{2})(([0-9a-fA-F]{2}){5})$
#2
MAC地址 正则表达式
^([0-9a-fA-F]{2})(([/\s:-][0-9a-fA-F]{2}){5})$
Mac地址以空格,"-",":"分开
^([0-9a-fA-F]{2})(([0-9a-fA-F]{2}){5})$
中间没有任何符号
^([0-9a-fA-F]{2})(([/\s:-][0-9a-fA-F]{2}){5})$
Mac地址以空格,"-",":"分开
^([0-9a-fA-F]{2})(([0-9a-fA-F]{2}){5})$
中间没有任何符号
#3
正解。
#4
正解,实践证明的