vue 去除输入框首位的空格

vue 去除输入框首位的空格

if(/^\s+|\s+$/g.test(value)){
alert(123);
}
vue 或者将首位的空格进行替换
 this.replace(/^\s+|\s+$/g, '');


身份证正则
(^[1-9]\\d{5}(18|19|([23]\\d))\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$)|(^[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{2}$)

 

posted @ 2018-06-26 12:47  一叶*秋  阅读(2435)  评论(0编辑  收藏  举报

博客侧边栏公告广告位招租