怎么在js中用正则表达式验证一个变量是6位数字function test(){var txt = "123456"var reg = ^d{6}bif(reg.test(txt)){ alert("ok")}else{ a2023-04-30JavaScript910