I just stumbled over an example for something even worse:
infinite loops
perlre#Repeated Patterns Matching a Zero-length Substring
> A common abuse of this power stems from the ability to make infinite loops using regular expressions, with something as innocuous as:
> "foo" =~ m{ ( o? )* }x;
> The o? matches at the beginning of "foo", and since the position in the string is not moved by the match, o? would match again and again because of the "*" quantifier. Another common way to create a similar cycle is with the looping modifier /g:
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
In reply to Re^2: Is it safe to use external strings for regexes? (infinite loops)
by LanX
in thread Is it safe to use external strings for regexes?
by stevieb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |