</pre><pre name="code" class="html">
</pre><pre name="code" class="html"><pre name="code" class="html"><span style="font-size:14px; font-family: Arial,Helvetica,sans-serif; background-color: rgb(255,255,255);">西方过加通用ddmmyyyyhhmmss</span>
例如:dd-mm-yy hh:mm:ss
^(?:(?:(?:0?[1-9]|1[0-9]|2[0-8])([-/.]?)(?:0?[1-9]|1[0-2])|(?:29|30)([-/.]?)(?:0?[13-9]|1[0-2])|31([-/.]?)(?:0?[13578]|1[02]))([-/.]?)(?!0000)[0-9]{4}|29([-/.]?)0?2([-/.]?)(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00))([-/ ]?)([01][0-9]|2[0-3])([-/:]?)[0-5][0-9]$
中国通用yyyymmddhhmmss
^(?:(?!0000)[0-9]{4}([-/.]?)(?:(?:0?[1-9]|1[0-2])\1(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])\1(?:29|30)|(?:0?[13578]|1[02])\1(?:31))|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)([-/.]?)0?2\2(?:29))([-/ ]?)([01][0-9]|2[0-3])([-/:]?)[0-5][0-9]([-/:]?)[0-5][0-9]$
<pre name="code" class="java">
参考:http://blog.csdn.net/lxcnn/article/details/4362500原文链接:https://www.f2er.com/regex/360772.html