title: Javascript: Extract MAC codes from freeform text using Regex
body: <p>I'm attempting to write a Chrome Extension that will scan a web page for valid MAC codes and push each in to an array. I have a regex that validates the MAC but I can't get it to match multiple codes.</p>
  
  <p>Here is a quick snippet of my code :</p>
  
  <pre><code>var regex = /^([0-9A-F]{2}[:-]){5}([0-9A-F]{2})$/;
  var body = document.body.innerText.replace(/\n/g,' ');
  
  console.log(body.match(regex));
  
  var occur = regex.exec(body);
  
  console.log(occur);
  </code></pre>
  
  <p>Many thanks.</p>