AG
Regex
AGREGEX
About
Cheat Sheet
Pattern Library
Guides
Contact
한국어
English
日本語
中文
Español
Português
Français
Deutsch
Русский
العربية
Bahasa Indonesia
← Pattern Library
PATTERN
ISO Date (YYYY-MM-DD)
Regex Pattern
Date · Time
/
\b\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])\b
/g
Copy
/\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
24-Hour Time
← Pattern Library