Regular Expressions 101

Community Patterns

MAC Address

1

Regular Expression
Python

r"
(?i)^[a-f\d]{2}([.:-]?)([a-f\d]{2}\1){4}[a-f\d]{2}$
"
gm

Description

Match mac address with :, -, ., or no dividers.

Submitted by Brandan Neises - 3 years ago