Regular Expressions 101

Community Patterns

Match a valid MAC address (with optional delimiters)

1

Regular Expression
PCRE2 (PHP >=7.3)

/
^([0-9A-Fa-f]{2}[:-]){5}[0-9A-Fa-f]{2}$
/
gm

Description

Submitted by anonymous - a month ago