Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
ECMAScript (JavaScript)

/
^([1-9]\d*)-(0[1-9]|1[0-2])-(0?[1-9]|[1-2]\d|3[0-2])(?:\x20([01][0-9]|2[0-3]):([0-5]\d):([0-5]\d)(\.\d+)?)?$
/
gm

Description

Substitutes a group of dates by its information and captures the date information. Also allows fooled dates. (2015-02-30, 2015-03-32 for example)

Submitted by luis140219 on GitHub - 10 years ago