日期验证正则表达式

下面提供了三款日期验证正则表达式哦,你可以根据自己的需选择下面三种中期其中一种日期验证方法

  1. */  
  2.  
  3. $arr_date = array
  4. '2004-06-01'
  5. '2005-0x-10'
  6. '12-12-12'
  7. '2000-12-25 00:10:20'
  8. '2007-12-05' 
  9. ); 
  10. for ($i=0; $i<5; ++$i
  11.  $date = $arr_date[$i]; 
  12.  if(ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})"$date$regs)) 
  13.  { 
  14.      echo "日期字符串$date 符合'yyyy-mm-dd'格式:"
  15.      echo "$regs[1].$regs[2].$regs[3]<br/><br/>"
  16.  } 
  17.  else 
  18.  { 
  19.      echo "<b>日期字符串$date 不符合'yyyy-mm-dd'格式的日期字符串</b><br/><br/>"
  20.  } 
  21. //匹配yyyy-mm-dd 
  22.  
  23. (([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29) 
  24.  
  25.  
  26. //2:匹配dd/mm/yyyy 或匹配d/m/yyyy 
  27.  
  28. '/^(([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|' 
  29.                                 .'[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})/((([13578]|1[2])|(0[13578]|1[02])' 
  30.                                 .'/((0[1-9]|[12][0-9]|3[01])|([1-9]|[12][0-9]|3[1])))|(((0[469]|11)|([469]|11))' 
  31.                                 .'/((0[1-9]|[12][0-9]|30)|([1-9]|[12][0-9]|30)))|' 
  32.                                 .'((02|2)/((0[1-9]|[1][0-9]|2[0-8])|([1-9]|[1][0-9]|2[0-8]))' 
  33.                                 .')))|((([0-9]{2})((0[48]|[2468][048]|[13579][26])|([48]|[2468][048]|[13579][26]))|' 
  34.                                 .'((((0[48])|([48]))|[2468][048]|[3579][26])00))/(02|2)/29)$/'
波比源码 – 精品源码模版分享 | www.bobi11.com
1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长!
2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 本站源码并不保证全部能正常使用,仅供有技术基础的人学习研究,请谨慎下载
8. 如遇到加密压缩包,请使用WINRAR解压,如遇到无法解压的请联系管理员!

波比源码 » 日期验证正则表达式

108 评论

  1. buy isosorbide digoxin ca buy micardis 20mg online cheap

  2. buy provera 5mg without prescription biltricide 600mg cost order cyproheptadine 4 mg for sale

  3. retin cream without prescription retin gel drug order avana 100mg

  4. poker online play slot games play online blackjack for real money

  5. online blackjack with friends canada pharmacy write research papers

  6. order temovate sale clobetasol drug purchase amiodarone for sale

  7. buy ropinirole 2mg without prescription cheap trandate labetalol tablet

  8. order tadalafil for sale Cialis prices buy best erectile dysfunction pills

  9. buy ondansetron 8mg sale zofran order buy generic bactrim 960mg

  10. azathioprine 50mg ca oral imuran order naproxen 250mg sale

  11. promethazine online price cialis buy cialis 5mg pill

  12. order cialis 40mg online cheap cialis by mail order sildenafil 100mg generic

  13. buy generic avanafil 200mg avanafil 100mg uk order diclofenac 50mg sale

  14. buy generic dapoxetine for sale brand priligy 30mg order orlistat 120mg sale

  15. Monitor Closely 2 levoketoconazole will increase the level or effect of estrogens esterified by P glycoprotein MDR1 efflux transporter cialis 5mg best price Dai B, Liu Y, Fu L, Li Y, Zhang J, Mei C 2012 Effect of theophylline on prevention of contrast induced acute kidney injury a meta analysis of randomized controlled trials

  16. tadalafil cialis cialis brand sildenafil 100mg pills for sale

  17. order lansoprazole online cheap prevacid 15mg drug order protonix without prescription

  18. pyridium 200 mg tablet singulair cost symmetrel 100 mg drug

  19. nitrofurantoin 100 mg over the counter motrin where to buy nortriptyline 25mg drug

  20. lamivudine drug epivir cost accupril where to buy

  21. Noncontrast computed tomography CT scan in a 52 year old man with a history of worsening right sided weakness and aphasia demonstrates diffuse hypodensity and sulcal effacement with mass effect involving the left anterior and middle cerebral artery territories consistent with acute infarction finasteride 5mg without a prescription

评论已关闭

Hi, 如果你对这款模板有疑问,可以跟我联系哦!

联系站长
赞助VIP 享更多特权,建议使用 QQ 登录
喜欢我嘛?喜欢就按“ctrl+D”收藏我吧!♡