Go back to RegexSwap.

ISO date (yyyy-mm-dd)

Try it out on these example inputs:

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:

time

Popularity:

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

Good
1
Bad
0

Author description and comments (0)

Topic by
kasper

2009-01-06
12: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.

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

Username:

Password:

Requested username:

Password:

Real name:

Email address:

Title:

Company:

Country: