Node.js examples for Regular expression:Validation
Validate HTML tag using regex
Validator.validateHtmltag = function(tag) { var exp = /^<([a-z]+)([^<]+)*(?:>(.*)<\/\1>|\s+\/>)$/; if (tag.match(exp)) { return true; } else {//from w w w.ja v a 2s. c om return false; } };