Skip to content

regex/date

  • day: RegExp matching an ISO 8601 day of the month: 01–31 (shape only; whether the day exists in its month is checked by Temporal.PlainDate.from in isValidDate).
  • month: RegExp matching an ISO 8601 month: 01–12.
  • plainDate: RegExp matching ISO 8601 calendar date (extended): YYYY-MM-DD or ±YYYYYY-MM-DD.
  • year: RegExp matching the shape of an ISO 8601 year: 4 digits, or a sign and 6 digits (Temporal’s DateYear).