JS正则表达式验证非常全

//去除首尾空格

this.usernmae.replace(/^\s\s*/'').replace(/\s\s*$/'');

//全部空格

this.usernmae.replace(/\s+/g,"");

posted @ 2020-06-02 11:30  最初的样子  阅读(260)  评论(0编辑  收藏  举报