日期:2014-05-17  浏览次数:20461 次

求YYYY-MM-DD HH:MM:SS RegularExpressionValidator控件的正则表达式
RT!

------解决方案--------------------
^((((1[6-9]|[2-9]\d)\d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]\d|30))|(((1[6-9]|[2-9]\d)\d{2})-0?2-(0?[1-9]|1\d|2[0-8]))|(((1[6-9]|[2-9]\d)(0[048]|[2468][048]|[13579][26]))-0?2-29))$/
------解决方案--------------------
var t1 = /^((((1[6-9]|[2-9]\d)\d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]\d|30))|(((1[6-9]|[2-9]\d)\d{2})-0?2-(0?[1-9]|1\d|2[0-8]))|(((1[6-9]|[2-9]\d)(0[048]|[2468][048]|[13579][26]))-0?2-29))$/.test(this)
------解决方案--------------------
var t1 = /^((((1[6-9]|[2-9]\d)\d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]\d|30))|(((1[6-9]|[2-9]\d)\d{2})-0?2-(0?[1-9]|1\d|2[0-8]))|(((1[6-9]|[2-9]\d)(0[048]|[2468][048]|[13579][26]))-0?2-29))$/.test(this)
------解决方案--------------------
[code=C#]^((((1[6-9] ¦[2-9]\d)\d{2})-(0?[13578] ¦1[02])-(0?[1-9] ¦[12]\d ¦3[01])) ¦(((1[6-9] ¦[2-9]\d)\d{2})-(0?[13456789] ¦1[012])-(0?[1-9] ¦[12]\d ¦30)) ¦(((1[6-9] ¦[2-9]\d)\d{2})-0?2-(0?[1-9] ¦1\d ¦2[0-8])) ¦(((1[6-9] ¦[2-9]\d)(0[048] ¦[2468][048] ¦[13579][26]))-0?2-29))$[code]
------解决方案--------------------
^((((31\/(0?[13578]|1[02]))|((29|30)\/(0?[1,3-9]|1[0-2])))\/
(1[6-9]|[2-9]\d)?\d{2})|(29\/0?2\/(((1[6-9]|[2-9]\d)?(0[48]|
[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))|
(0?[1-9]|1\d|2[0-8])\/((0?[1-9])|(1[0-2]))\/((1[6-9]|[2-9]\d
)?\d{2})) (20|21|22|23|[0-1]?\d):[0-5]?\d:[0-5]?\d$

验证: [29/02/2004 20:15:27], [29/2/04 8:9:5], [31/3/2004 9:20:17]
------解决方案--------------------
(((0?[13578]|1[02])/(0?[1-9]|[12]\d|3[01])/((1[6-9]|[2-9]\d)\d{2}))|((0?[13456789]|1[012])/(0?[1-9]|[12]\d|30)/((1[6-9]|[2-9]\d)\d{2}))|(0?2/(0?[1-9]|1\d|2[0-8])/((1[6-9]|[2-9]\d)\d{2}))|(0?2/29/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$