Is it a valid nick name - Node.js Regular expression

Node.js examples for Regular expression:Validation

Description

Is it a valid nick name

Demo Code

exports.validNick = function(nickname) {
    var regex = /^\w*$/;
    return regex.exec(nickname) !== null;
};

Related Tutorials