RegexWars
Tier 4 · Enchanterreplace

The Wrong Way Round

Rewrite every DD/MM/YYYY date as YYYY-MM-DD, leaving the rest of the text alone.

Three groups out, three groups back in a different order. Exactly two digits for the day and the month, and they have to be digits — a quantifier loose enough to take any character will cheerfully reorder a file path. Exactly two also has to mean exactly: without a guard on each end, the pattern finds a two-digit date sitting inside a longer run of digits and rewrites half of it. This challenge is about the shape of a date, not its validity — 45/99/2026 has the shape and is nobody's birthday, and pinning real ranges costs far more than it teaches here.

Your pattern0 chars · par 45
//
Flags
Start typing — tests run as you go.0 of 5 visible tests passing
Test cases
  • 11/08/2026→ "2026-08-11"
  • due 01/02/2026 sharp→ "due 2026-02-01 sharp"
  • 25/12/2025 and 01/01/2026→ "2025-12-25 and 2026-01-01"
  • no date here→ "no date here"
  • tag v1/eu/beta shipped→ "tag v1/eu/beta shipped"

    not digits, not a date

+ 5 hidden tests, checked when you submit. They are what stops a pattern that only fits the examples above.