parsed.org
Match a MAC Address by xinu on Jun 14, 2008 08:28 PM

Regex to match a colon or hyphen delimited MAC address:

\A                                   # beginning of line
  (?:                                # start cluster first 5 bytes
    [a-f0-9]{2}[:] | [a-f0-9]{2}[-]  # colons or hyphens
  ){5}                               # end cluster first 5 bytes
  [a-f0-9]{2}                        # final byte
\z                                   # end of string
colonhyphenmacpcreregex
RSS