如何使用正则匹配一个汉字
Issue 欢迎在 Gtihub Issue 中回答此问题: Issue 655
Author 回答者: wangjiayan
/\p{Unified_Ideograph}/u
Author 回答者: jkLennon
var pattern1 = /[\u4e00-\u9fa5]+/g; var contents = “[微笑][撇嘴][发呆][得意][流泪]”; var content = contents.match(pattern1);
Issue 欢迎在 Gtihub Issue 中回答此问题: Issue 655
Author 回答者: wangjiayan
/\p{Unified_Ideograph}/u
Author 回答者: jkLennon
var pattern1 = /[\u4e00-\u9fa5]+/g; var contents = “[微笑][撇嘴][发呆][得意][流泪]”; var content = contents.match(pattern1);