Try it out on these example inputs:

back to RegexSwap.

ISO date (yyyy-mm-dd)

Regular expression:

^((((19|20)(([02468][048])|([13579][26]))-02-29))|((20[0-9][0-9])|(19[0-9][0-9]))-((((0[1-9])|(1[0-2]))-((0[1-9])|(1[[0-9]])|(2[0-8])))|((((0[13578])|(1[02]))-31)|(((0[1,3-9])|(1[0-2]))-(29|30)))))$

Categories:

Popularity:

You need to be logged in to cast votes on regexes.

Good
1
Bad
0

Author description and comments (1)

Topic by
kasper

2009-01-06
11:08

Description

Defines a datemask composed of a 4-digit year, a 2-digit month and a 2-digit date.

Trailing zero's are required in single digit months or dates.

Comment by
weatheredwatcher


Now this one was spot on wonderful!!

You need to be logged in to participate

In order to post your own comments on this regex, you need to be logged in.

Username:

Log in by clicking the login link at the top of the screen