Networkingflags: g
MAC Address
Match 48-bit MAC addresses written with colon or hyphen separators (e.g. 00:1A:2B:3C:4D:5E).
Try it in RegexPro →Available in
Pattern
regexengine-agnostic
(?:[0-9A-Fa-f]{2}[:\-]){5}[0-9A-Fa-f]{2} (flags: g)Raw source: (?:[0-9A-Fa-f]{2}[:\-]){5}[0-9A-Fa-f]{2}
How it works
Five pairs of hex digits each followed by : or -, then a final hex pair. Case-insensitive by character class to handle both upper and lower hex digits.
Examples
Input
00:1A:2B:3C:4D:5EMatches
00:1A:2B:3C:4D:5E
Input
AA-BB-CC-DD-EE-FFMatches
AA-BB-CC-DD-EE-FF
Input
not a macNo match
—Common use cases
- •DHCP lease log parsing
- •Device inventory scans
- •Wi-Fi access control configuration
- •Network security monitoring
Related patterns
IPv6 Address
NetworkingMatch full (non-compressed) IPv6 addresses written as eight colon-separated hextets.
IP Address with CIDR Notation
NetworkingMatch IPv4 addresses with CIDR prefix notation such as 10.0.0.0/8 or 192.168.1.0/24.
IPv4 Address
NetworkingMatch valid IPv4 addresses with each octet constrained to 0–255.
Private IP Address (RFC 1918)
NetworkingMatch IPv4 addresses in the RFC 1918 private ranges: 10/8, 192.168/16, and 172.16/12.