Cheatsheet Pages / Regex Cheatsheet

A regex for dates in YYYY-MM-DD format

You want the shape of an ISO date checked quickly.

Patterns use the syntax shared by PCRE / Python / JavaScript; engine differences are flagged in the cheatsheet where they matter. Test any pattern at regex101.com — and pick the matching engine.

\d{4}-\d{2}-\d{2}
# matches: 2026-10-09

Good to know

This checks the format, not the calendar — 2026-13-99 still matches; validate real dates in code.

Regex Cheatsheet one-page card — patterns that actually work
The full one-page card — Regex Cheatsheet. Get the complete cheatsheet on GitHub