Welcome to Regex Hunter โ and the Joy of Regex Golf
Regex Hunter ยท 6/22/2026
The shortest path wins
Every day, Regex Hunter hands you two lists of words. One list is the monsters โ words your pattern must catch. The other is the innocents โ words it must let walk free. Write a single regular expression that matches all the monsters, none of the innocents, and you've cleared the hunt.
The twist: every character costs you. A pattern that works isn't the goal โ the shortest pattern that works is. That's regex golf, and like the game it's named after, the lowest score takes the trophy.
A two-character lesson
Say the hunt looks like this:
- Catch:
cat,car,can - Spare:
dog,bus
The obvious answer is to spell out every monster:
cat|car|can
Eleven characters, and it works. But look closer โ every monster starts with
ca, and neither innocent contains those two letters anywhere. A regex doesn't
have to match a whole word; it only has to find its pattern somewhere inside.
So this is enough:
ca
Two characters. Same result. That leap โ from "spell out the answer" to "find the smallest thing the monsters share and the innocents lack" โ is the whole game in miniature.
Why play?
Regex shows up everywhere: search-and-replace, log filtering, form validation, that one config file nobody fully understands. Most people learn just enough to get by and never get comfortable. Golf flips the usual pressure. Instead of "make it work," you start asking "what's actually going on here?" โ and that question is how the syntax finally clicks. Character classes, anchors, alternation, quantifiers: you reach for them because they save keystrokes, and they stick because you earned them.
It's also just fun. There's a specific satisfaction in watching a clumsy 20-character pattern collapse into a tidy six.
Three habits to start with
- Look for shared substrings first. Before writing alternation, ask what the monsters have in common that the innocents don't.
- Don't over-anchor.
^and$cost characters and are often unnecessary. Add them only when an innocent forces your hand. - Lean on character classes.
[aeiou]beatsa|e|i|o|u, and\dbeats[0-9].
See you on the board
A fresh hunt drops every day, and there's a whole archive plus practice packs if you want to warm up first. Pick today's puzzle, find the monsters' weakness, and see how low you can score.
Happy hunting.