我正在使用以下正则表达式验证5位邮政编码。但它无法工作。
var zipcode_regex = /[\d]{5,5}/;
if (zipcode_regex.test($.trim($('#zipcode').val())) == false)
alert('invalid zipcode');
在这段代码片段中,我还使用了jQuery。