简单正则问题
p=/^\d{2,4}$/g;
s='55 44';
ss=s.replace(/\s/,'')+'|';
alert(p.test(ss));
已经去空格了,为什么还是false?谢谢讲解
[解决办法]
p=/^\d{2,4}$/g;//字符串中只含有2到4个数字s='55 44';ss=s.replace(/\s/,'')+'|';//ss='5544|'alert(p.test(ss));
[解决办法]
p=/^\d{2,4}$/g;
ss=s.replace(/\s/,'')+'|';
[解决办法]
多了'|'