正则表达式:不能包含某些特殊字符串

# js正则 不包含 list、news、index
/^((?!list|news|index).)*$/.test('list0')

 

 

js 中文不含标点

/[\u4E00-\u9FA5\uf900-\ufa2d]/.test('啊')

 

php 中文不含标点

if (preg_match("/[\x{4e00}-\x{9fa5}\x{f900}-\x{fa2d}]+$/u", '啊', $matches)) {
    echo($matches[0]);
}
else {
    echo('not match');
}

 

posted @ 2019-04-26 10:54  kjcy8  阅读(14763)  评论(0编辑  收藏  举报