/^/
MediumValidation

ISO Date Format Checker

Write a regex that checks whether a string follows the YYYY-MM-DD digit layout (four digits, dash, two digits, dash, two digits). It only needs to check the shape, not whether the date is a real calendar date.

//
2026-07-10 / 2026-7-10 / 07-10-2026 / 2026/07/10 / 9999-99-99

Test cases

  • 2026-07-10expect match
  • 2026-7-10expect no match
  • 07-10-2026expect no match
  • 2026/07/10expect no match
  • 9999-99-99expect match
  • abcd-ef-ghexpect no match