Taking the regular expression from this question , you would do it like this:
var mystring= 'Hello';
var regex = /^([0-9A-F]{2}[:-]){5}([0-9A-F]{2})$/;
alert(regex.test(mystring));
http://jsfiddle.net/s2WDq/
^, TWO hexidecimal digits [0-9A-F]{2}, [:-], (...){5}, [0-9A-F]{2} , , $.
: Pinch MAC-. , , ? :
/^([0-9A-F]{2}[:-]?){5}([0-9A-F]{2})$/
// question mark ^ allows the colon or dash to be optional