I am trying to ensure the date is in YYYY-MM-DD with the following code:(我正在尝试使用以下代码确保日期在YYYY-MM-DD中:)
var exp = d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12][0-9]|3[01]);
for(i=0; i<array.length; i++)
if(!exp.test(array[i].value)
//do something
What i have is currently not working, the contents of my if statement are not executing, which leads me to believe either my if statement is set up wrong or my regular expression is wrong, I am stuck on it and cannot figure it out(我目前所拥有的无法正常工作,如果if语句的内容未执行,这使我相信我的if语句设置错误或我的正则表达式错误,我被卡住了,无法弄清楚)
ask by Anna translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…