Many thanks! I didn't know about warnings. But I noticed new issue. The problem is that when this warning appears the regex doesn't match... I changed line to print "not matched" if $TestString !~ m/^(a+|b)*$/; and for string 256000 and above regex is not able to match. Also when I use possessive quantifiers (m/^(a++|b)*+$/) performance improves a lot but still it does not match for strings larger than 256000.
I don't understand regex engine in Perl... I also checked the same regexes for Python and PHP (PCRE) and they work similar to Java. I doubt that this is bug in Perl and I cannot match big input strings. There must be something I don't know.
In reply to Re^2: Strange behaviour of the regex engine (pathological protection)
by thof
in thread Strange behaviour of the regex engine
by thof
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |