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
MAC addresses are typically 6 groups of two hexadecimal digits (0-9,A,B,C,D,E,F), separated either by colons (:) or hyphens (-).
Are you looking for this?
/([0-9A-F]{2}(?:[:-][0-9A-F]{2}){5})/g
Online demo
Get the matched group from index 1.