⏳ Connecting to local server...
⛳ RegEx Golf
Write the shortest regular expression to match — and avoid — the right words!
Select Hole
Hole 1 of 10
0%
Hole 1
Star Wars vs Star Trek
⭐
Par:
?
Shots:
0
| Best:
—
✅
MATCH THESE
❌
AVOID THESE
Your regex:
0 chars
Best:
—
/
/
⛳ Test!
Type a regex above and hit Test to take your shot!
← Prev
Next →
💡 Hint
↺ Reset
📖 Regex Cheat Sheet
▲
Symbol
What it does
Example
Characters
.
Any single character
b.t → "bat", "bit"
\d
Any digit 0–9
A\d → "A1", "A9"
\w
Word char (a–z, A–Z, 0–9, _)
\w+ → "hello"
\s
Whitespace (space, tab)
a\sb → "a b"
Anchors
^
Start of string
^Cat → "Cat", not "sCat"
$
End of string
end$ → "end", not "ending"
Quantifiers
*
0 or more of previous
go* → "g", "go", "goo"
+
1 or more of previous
go+ → "go", "goo"
?
0 or 1 — makes it optional
colou?r → "color", "colour"
{n}
Exactly n times
a{3} → "aaa"
{n,m}
Between n and m times
a{2,4} → "aa"–"aaaa"
Character Classes
[abc]
Any one of a, b, or c
[cbr]at → "cat", "bat"
[a-z]
Any character in range
[A-Z]\w+ → "Hello"
[^abc]
Any character NOT listed
[^aeiou] → consonants
Groups & Alternation
(ab)
Group — treat as a unit
(go)+ → "go", "gogo"
a|b
a OR b — either matches
cat|dog → "cat" or "dog"
Escaping
\.
Literal dot (not wildcard)
3\.14 → "3.14" only
\(
Literal bracket
\(hi\) → "(hi)"
💡
Tips:
Shorter regex = lower score · You only need to match
part
of a word · Matching is
case-sensitive
· Use
|
for OR
🏆 High Scores
▲
#
Name
Chars
Regex
No scores yet — be the first! ⛳
🎉
Hole Complete!
You matched all words with:
Save Score 🏆
Skip
🎉