Node.js examples for String:Parse
Check whether the string is a hex
/*// w w w . j a va 2 s . c o m Check whether the string is a hex - e.g. #FF00FF or #FFF. \ @param {this} The string to check. @return {boolean} Whether the string is a hex or not. */ String.prototype.isHex = function() { return /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(this); };