Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
([\da-f]{2}\-){5}([\da-f]{2})
/
gm

Description

Mac address is 6 parts of 2 hexadecimal digits separated by a special character "-" so, there are 5 parts of digits followed by the character "-" then, one part without that character.

Submitted by EMAM1999 - 4 years ago