Summary
A regular expression can be used to match a valid date in the format yyyy-mm-dd from 1900-01-01 to 2099-12-31, with a choice of four separators.
1
Additionally, a regex can be used to match any traditional date format, including numbers, and any combination of digits for the day and month, and any combination of one or two digits for the year.
2
According to
See more results on Neeva
Summaries from the best pages on the web
Summary
$ matches a date in yyyy-mm-dd format from 1900-01-01 through 2099-12-31, with a choice of four separators. The anchors make sure the entire variable is a date, and not a piece of text containing a date. The year is matched by ( 19 | 20 ) \d \d .
Example: Regular Expression Matching a Valid Date
regular-expressions.info
Summary
Regular Expressions Cookbook, 2nd Edition by Jan Goyvaerts and Steven Levithan provides a simple regex that checks whether the input looks like a date without trying to weed out things such as February 31st. The regex can be used in a variety of languages, including.NET, Java, JavaScript, PCRE, Perl, Python, and Ruby, and can be used to match any of the traditional date formats. The regex can also be used to match numbers, and can be used to match any combination of digits for the day and month, and any combination of one or two digits for the year.
4.4. Validate Traditional Date Formats - Regular Expressions Cookbook, 2nd Edition [Book]
oreilly.com
Most important things to know about Date regex and examples of validation and extraction of Date from a given string in JavaScript programming language.
Date regex | UI Bakery
uibakery.io
RegExr is an online tool to learn , build , & test Regular Expressions (RegEx / RegExp). Supports JavaScript & PHP/PCRE RegEx. Results update in real-time as ...
RegExr: Learn, Build, & Test RegEx
regexr.com