Developer Tool

Regex Cheatsheet for Dates & Timestamps

Ready-to-use regular expressions for the date and timestamp formats developers match against most often — test any of them live against your own string.


    
    
    

Why regex is the wrong tool for validating a date is real

None of these patterns check whether a date is actually valid — a regex will happily match 2026-02-31 even though February never has 31 days. Regex is good for confirming a string is shaped like a date; confirming it's a real, valid calendar date needs to happen with an actual date parser afterward. For that step, see the ISO 8601 Validator, which does full validation, not just shape-matching.

Related

Related tools