The format for MAC addresses is not standardized. I’ve seen them with
(Win, RedHat) and without (Solaris) leading zeros, colons (RH, Solaris)
or hyphens (Win) as separators, and uppercase (Win, RedHat) or lowercase
(Solaris) hex values. I think I’ve also seen network gear that shows
them as xxxx:xxxx:xxxx. It really depends on where the MAC info is
These may not be perfect, but you get the idea.
You could try normalizing the string by replacing all colons with
hyphens and then adding a leading zero to all single character values,
and then applying your regex.
GeneOn 6/2/2010 2:06 PM, Troy Knabe wrote:
I am trying to do a regex for mac address verification. My first attempt
looks like this, but did not work. Anyone have any insight as to what I