Regular Expressions 101

Community Patterns

There does not seem to be anything here

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

/
^(?:([[:xdigit:]]{2})([^[:xdigit:]]?)(?1)(\2(?1))(?3){3}|((?1){2})((?2))(?4)\5(?4))$
/
gm

Description

This regular expression matches various MAC addresses formats. It doesn't care about the case, neither the separator character as long as the same is used. Take a look at the test strings to learn more.

Submitted by anonymous - a month ago (Last modified a month ago)