MAC Address

Matches a valid MAC address.

Contributed by @itsbrunodev

regex
^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$
sh
# Valid MAC addresses
00:1A:2B:3C:4D:5E
FF:FF:FF:FF:FF:FF
 
# Invalid MAC addresses
00:1A:2B:3C:4D
G1:1A:2B:3C:4D:5E

Keywords

mac
address
network