Five puzzles, increasing difficulty
If you can solve all five, you've internalized this quest. Try each in your head first; check the answer at the bottom only after you have a candidate.
Puzzle 1: Match palindromes of length 3-5
Words that read the same forwards and backwards: 'mom', 'eye', 'level', 'civic'. Use word boundaries.
Puzzle 2: Match 'fizz' but not when preceded by 'buzz'
Find 'fizz' in text, but skip occurrences where 'buzz' immediately precedes (with optional space).
Puzzle 3: Match strings with EXACTLY two vowels
'cat' (1), 'beat' (2), 'beats' (2), 'beautiful' (5). Only 'beat' and 'beats' should match.
Puzzle 4: Strip ANSI color codes
Terminal output often has codes like \x1b[31m or \x1b[1;32m. Remove them all without removing other content.
Puzzle 5: Find duplicate adjacent words
Detect things like 'the the cat' or 'sat sat'. Return the duplicated word.
Spoilers (after you've tried)
1. \b(\w)(\w?)(\w)?\3\2?\1\b — capturing pairs around the center, using backreferences and optional matching.
2. (?<!buzz\s?)fizz — negative lookbehind. (Variable-width lookbehind needed; Python regex module or fixed-width pad.)
3. ^[^aeiou]*[aeiou][^aeiou]*[aeiou][^aeiou]*$ — non-vowels, vowel, non-vowels, vowel, non-vowels.
4. \x1b\[[\d;]*m — escape, bracket, digits and semicolons, m.
5. \b(\w+)\s+\1\b — backreference to detect repetition.
The graduation
If you understood all five — including the trade-offs (Puzzle 2's lookbehind variability, Puzzle 1's center-character handling) — you've graduated. The rest is practice. Keep regex101 bookmarked, treat lookaround as a power tool not a default, and remember the Golden Rule: smallest tool that solves the shape problem.