Node.js examples for Regular expression:Validation
Validate User name Or Password using regex
Validator.validateUsernameOrPassword = function(username) { var exp = /^[a-zA-Z0-9_?\-?]+$/; if (username.match(exp)) { return true; } else {// w w w . ja va 2 s . c om return false; } };