NedStarkOfWinterfell
NedStarkOfWinterfell

Reputation: 5203

Why is this regex throwing a 'PREG_BACKTRACK_LIMIT_ERROR' error?

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?

Upvotes: 2

Views: 1072

Answers (1)

wesside
wesside

Reputation: 5740

Catastrophic Backtracking.

Incorrect nesting.

Upvotes: 5

Related Questions