Java中以英文逗号分割的字符串在前端添加时正则判断
只能是英文状态逗号,不能有中文逗号
var m=/[\uff0c]/;
if(goodstype.match(m)){
alert("不能有中文逗号");
return;
}
能以逗号隔开不能以逗号结尾
var x=/^([\u0391-\uFFE5\d\w,])*([\u0391-\uFFE5\d\w]+)$/;
if(!goodstype.match(x)){
alert("只能以逗号隔开或不能以逗号结尾或不能有中文逗号");
return;
}