2

In the example at PHP.net, it says that the regular expression /(?:\D+|<\d+>)*[!?]/ matched against foobar foobar foobar throws a PREG_BACKTRACK_LIMIT_ERROR error. Can anybody explain why?

SexyBeast
  • 7,913
  • 28
  • 108
  • 196

1 Answers1

5

Catastrophic Backtracking.

Incorrect nesting.

wesside
  • 5,622
  • 5
  • 30
  • 35
  • 2
    Thanks. That is a good link. Can you tell me what is meant by the sentence **The group has one iteration it can backtrack into.** in the 2nd line of the 3rd paragraph? – SexyBeast Sep 11 '12 at 19:02