in reply to Re: Strange behaviour of the regex engine (pathological protection)
in thread Strange behaviour of the regex engine
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Strange behaviour of the regex engine (bug)
by tye (Sage) on Jan 06, 2015 at 21:46 UTC | |
|
Re^3: Strange behaviour of the regex engine (pathological protection)
by Anonymous Monk on Jan 06, 2015 at 21:52 UTC |