正则表达式整理ing

作用 正则表达式
去除空格 _strs.value.replace(/^(\s|\u00a0)+|(\s|\u00a0)+$/g,"")
只能输入数字 _this.value = _v.replace(/\D/g,"");
只能输入中文  _this.value = _v.replace(/[^\u4e00-\u9fa5]/g,"");
posted @ 2016-10-08 16:38  Viola_left  阅读(110)  评论(0)    收藏  举报