个人-正则

1.

 /\s/表示,空白 为 true

/\S/表示,非空白 为 true

new RegExp(/\S/).test('  ') => fasle

2.

// 不含空格 不含特殊字符:中间点“•” 除外 长度50
containSpaces: /^[\u4e00-\u9fa5_a-zA-Z0-9|•|·]{0,50}$/

posted on 2019-10-18 10:47  童彪  阅读(155)  评论(0编辑  收藏  举报

导航