JS正则表达式验证非常全

//去除首尾空格

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

//全部空格

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

原文地址:https://www.cnblogs.com/dreamstartplace/p/13030196.html