C.W.K.
Stream
Quiz · 5 questions

🎯 Groups & Alternation

Capture, name, reuse — and the | that splits patterns into branches

Level 0Pattern-Curious
0 XP0/90 lessons0/15 achievements
0/100 XP to next level100 XP to go0% complete

Quiz

01What's the difference between (...) and (?:...)?
Hint
(?:...) groups without allocating a capture slot.
02Pattern cat|cats against input cats matches what?
Hint
Most engines are first-match, not longest-match.
03What does \b(\w+)\s+\1\b match?
Hint
\1 requires the same TEXT, not the same pattern.
04Pattern my cat|dog against my dog matches what?
Hint
Pipe binds looser than anything else in regex.
05Why prefer named groups over numbered groups in long patterns?
Hint
Group numbers shift when you edit; names don't.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.