← Pattern Library PATTERN
Date · Time
/\b\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])\b/g
Date · Time Flags: g
Description
Matches ISO 8601 dates in YYYY-MM-DD format. The month is limited to 01–12 and the day to 01–31, filtering out invalid values like 2026-13-40. It does not verify the actual number of days in a calendar month.
Example Matches
2026-07-02
1999-12-31
Test String
Release 2026-07-02, deadline 2026-13-40 (invalid)
Open this pattern in the tester
Other Patterns