Node.js examples for String:Char
Match kanji character
// matches a single kanji character String.prototype.isaKanji = function(){ return !!this.match(/^[\u4E00-\u9FAF]$/); } // matches one or more kanji characters String.prototype.isKanji = function(){ return !!this.match(/^[\u4E00-\u9FAF]+$/); } //check if there's kanji in the string String.prototype.hasKanji = function(){ return !!this.match(/[\u4E00-\u9FAF]/); }