Welcome aboard! We are happy you are here and wish you good net-raft!
var http = require('http');
var srv = http.createServer(function (req, res) {
var strongRegex = new RegExp("^(?=.{8,})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*\\W).*$", "g");
var mediumRegex = new RegExp("^(?=.{7,})(((?=.*[A-Z])(?=.*[a-z]))|((?=.*[A-Z])(?=.*[0-9]))|((?=.*[a-z])(?=.*[0-9]))).*$", "g");
var enoughRegex = new RegExp("(?=.{6,}).*", "g");
var password = "Pass12*33";
var state;
if (false == enoughRegex.test(password))
state = 'More Characters!';
else if (strongRegex.test(password))
state = 'Strong!';
else if (mediumRegex.test(password))
state = 'Medium!';
else
state = 'Weak!';
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end(state);
});
srv.listen(3000);
console.log("Listening to Port 3000");
The most helpful NODEJS solutions