← Quiz: Regular Expressions: all 10 questions
Quiz: Regular Expressions · Question 5 of 10
Why should you avoid patterns like (a+)+$ on user input?
Why should you avoid patterns like (a+)+$ on user input?
- A.They are not valid regex
- B.Backtracking engines can take exponential time on them (ReDoS)
- C.They only match numbers
- D.They are context-free
Answer & explanation
Correct answer: Backtracking engines can take exponential time on them (ReDoS)
Nested quantifiers cause catastrophic backtracking on near-matching input.
Can you get the rest right without peeking?
Take the timed Quiz: Regular Expressions quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →