title: Regex for valid MAC addresses : not 88|87|FF|00
body: <p>A "valid" MAC address is 6 groups of hexadecimal character pairs, separated by a dash or colon.</p>
  
  <p>Example:</p>
  
  <pre><code>3D-F2-C9-A6-B3-4F
  08:F2:C9:A6:B3:4F
  </code></pre>
  
  <p>However, "invalid" MAC addresses contain hex pairs that are <code>00</code>, <code>FF</code>, <code>88</code> or <code>87</code>.</p>
  
  <p>Example:</p>
  
  <pre><code>00-00-00-00-00-00
  FF-FF-FF-FF-FF-FF
  88-88-88-88-87-88
  </code></pre>
  
  <p>This is what I got so far:</p>
  
  <pre><code>(?!8)([0-9A-F]{2})([:-][0-9A-F]{2}){5}
  </code></pre>
  
  <p>But for some reason I don't know why, I cannot use:</p>
  
  <pre><code>(?!88|87|FF|00)
  </code></pre>
  
  <p>For the negated portion of the regex. </p>
  
  <p><em>NOTE:</em> Not a duplicate SO entry because this looks for invalid hex pairs and excludes them.</p>