Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
(^0[1-9]|[12][0-9]|3[01])-(0[1-9]|1[0-2])-(\d{4}$)
/

Description

Any date that as a valid month, a valid date and a year composed of 4 numbers. You can change the '-' caracter to any divider you want.

Submitted by anonymous - 9 years ago