ISO date regex pattern

Copy and test a JavaScript regex for ISO date strings, with examples, limitations, and a one-click link to the regex tester.

ISO date regex pattern

Validate whole value

Use anchors to check whether the complete value matches.

Regex: ^\d{4}-\d{2}-\d{2}$

Flags: -

Search in text

Find matching fragments inside a larger block of text.

Regex: \b\d{4}-\d{2}-\d{2}\b

Flags: g

Examples that match

  • 2026-05-15
  • 1999-12-31

Examples that do not match

  • 2026/05/15
  • 15-05-2026

Limitations

This pattern matches ISO-style date strings. Use date parsing for full calendar validation.