mumingv
3/8/2019 - 7:18 AM

【Node】正则表达式

// 判断字符串是否以中文开头
if (req.query.filter.match(/[\x7f-\xff]/) || req.query.filter.length < 20) {
    //...
}