Node.js examples for Regular expression:Validation
Validate URL using regex
Validator.validateUrl = function(url) { var exp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/; if (url.match(exp)) { return true; } else {/*from w ww .j av a2 s .co m*/ return false; } };