Is valid Chinese - Node.js Regular expression

Node.js examples for Regular expression:Validation

Description

Is valid Chinese

Demo Code


var isValidChinese = function(str){
    var reg = new RegExp(/^[\u4e00-\u9fa5]+$/);
    if(typeof str === 'string') return reg.test(str);
    return reg.test(str.toString());
};

Related Tutorials