哪位兄弟给个验证MAC地址的正则表达式
要验证MAC地址
比如:
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}))$
发现不起作用
先谢谢了
------解决方案--------------------
Mac地址以空格,"-",":"分开
^([0-9a-fA-F]{2})(([0-9a-fA-F]{2}){5})$
------解决方案--------------------