MAC Address Regex

Example:
^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$ Matches: ✓ 00:1A:2B:3C:4D:5E ✓ 00-1A-2B-3C-4D-5E
Validate MAC addresses: ^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$
Try Regex Lab →

FAQs

Colon or dash separator?

Both are valid. [:-] matches either.