← All Games
🥋

Regex Dojo

Write regex patterns to match green strings and reject red ones.

Plays in browser⌨️Keyboard⏱️5–15 minMedium
🥋

Regex Dojo

Write regex patterns to match green strings and reject red strings. Progress through 20 levels — from simple literals to lookaheads.

🎯20 Levels
Real-time feedback
📚Learn by doing

How to Play Regex Dojo

  1. Read the challenge description — for example, "match all email addresses" or "match lines starting with a digit".
  2. Write a regex pattern in the input field to satisfy the challenge.
  3. The game highlights which test strings your pattern matches — green for correct matches, red for false positives.
  4. You must match all required strings without matching any of the forbidden ones to pass the challenge.
  5. Advance through 30+ progressively complex challenges, from literal matches to lookaheads and backreferences.

About Regex Dojo

Regex Dojo teaches regular expression syntax through hands-on challenges. Starting from simple literal matches and character classes, it builds progressively to lookaheads, backreferences, and complex multi-pattern expressions. Each challenge presents a set of strings to match and a set to reject — your regex must thread the needle between them. Instant visual feedback highlights matches in green and false positives in red.

A reference panel shows common syntax at a glance for learners. Ideal for developers learning regex or experienced engineers sharpening their pattern-writing instincts. Free in your browser, no download required.

Frequently Asked Questions

What regex flavour is used?
All challenges use JavaScript/ECMAScript regex syntax, which is the same flavour used in modern web browsers and Node.js — making the skills directly applicable to real-world development.
Are solutions provided?
Yes — after three failed attempts on a challenge, you can reveal the reference solution along with an explanation of the pattern used.
What difficulty levels are there?
Challenges span four difficulty bands: Beginner (literals, character classes), Intermediate (quantifiers, groups), Advanced (lookaheads, backreferences), and Expert (complex multi-condition patterns).
Can I use flags like case-insensitive (i)?
Yes — a flag selector is available next to the input field, letting you apply flags such as case-insensitive (i), multiline (m), and global (g) where the challenge allows.