CS Fundamentals Trainer · JavaScript · Security

Which regex shows catastrophic backtracking in V8 (time roughly doubling with each extra character) on input like 'a'.repeat(28) + '!'?

Which regex shows catastrophic backtracking in V8 (time roughly doubling with each extra character) on input like `'a'.repeat(28) + '!'`?

  1. `/^a+$/`
  2. `/^(a|b)+$/`
  3. `/^[a-z]+\d*$/`
  4. `/^(a+)+$/`

Difficulty: medium

Answer this question

Related questions