Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
(^([0-9a-fA-F]{2})+$)|((?:[0-9a-fA-F]{2}([:]))+(?:[0-9a-fA-F]{2})*([0-9a-fA-F]{2})+$)
/
gm

Description

match 00aabbcc... or 00:aa:bb:cc...

Submitted by minji - 9 years ago