RegexWars

Codewars, but the only language is regex.

next daily in --:--:--

Tier 3 · WarlockmatchDaily #21

Said It Twice

Match text where the same word appears twice in a row.

A backreference \1 matches whatever group 1 actually captured — not the pattern again, the text. This is the classic duplicated-word bug your editor highlights.

Your pattern0 chars · par 14
//
Flags
Start typing — tests run as you go.0 of 5 visible tests passing
Test cases
  • the the catmust match
  • hello hellomust match
  • a amust match

    any run of whitespace between them

  • the catmust not match
  • the theatremust not match

    theatre merely starts with the

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

Solve it, then shrink it

Passing is the easy half. Your score is the length of your pattern, so the real competition starts once it turns green.

No accounts, no setup

Everything runs in your browser. Nothing to install, nothing to sign up for, and every challenge is free — permanently.

68 challenges, eight tiers

From matching a literal word to writing the regex that detects prime numbers. Browse them all.

RegexWars — Codewars, but the only language is regex