Quiz · 5 questions
👁️ Lookahead & Lookbehind
Match positions instead of characters — the zero-width family
Level 0Pattern-Curious
0 XP0/90 lessons0/15 achievements
0/100 XP to next level100 XP to go0% complete
Quiz
01What does 'zero-width' mean in regex?
Hint
Position check, no character consumed.
02Pattern
\d+(?=kg) against 5kg flour matches what?Hint
The lookahead asserts but doesn't include the matched text.
03Why is Python's lookbehind restricted to fixed-width patterns?
Hint
The engine needs to know how far back to look.
04What does
(?=.*[A-Z])(?=.*\d).{8,} require?Hint
Multiple lookaheads at the same position = AND constraints.
05Which engines do NOT support lookaround at all?
Hint
Linear-time guarantee comes at a feature cost.
Comments 0
🔔 Reply notifications (sign in)Sign in — Please sign in to comment.
No comments yet — be the first.