New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regex: (*THEN) doesn't work as described #12737
Comments
From ph10@hermes.cam.ac.ukHello, My understanding of how (*THEN) works is that the test below should $ perl -e 'print (("ac" =~ /^(?=ab|ac)/)? "yes\n":"no\n")' $ perl -e 'print (("ac" =~ /^(ab|ac)/)? "yes\n":"no\n")' I discovered this because PCRE does match these patterns. Regards, -- Flags: Site configuration information for perl 5.16.2: Configured by nobody at Tue Dec 11 22:56:31 CET 2012. Summary of my perl5 (revision 5 version 16 subversion 2) configuration: Locally applied patches: @INC for perl 5.16.2: Environment for perl 5.16.2: |
From @tamiasOn Fri, Jan 25, 2013 at 09:23:54AM -0800, Philip Hazel wrote:
These work in 5.10.1, but not in 5.14.1. These are the only tests involving (*THEN) that expect a successful match, { The key difference seems to be that in your tests, the two alternations Ronald |
The RT System itself - Status changed from 'new' to 'open' |
From @b2gillsOn Fri, Jan 25, 2013 at 4:17 PM, Ronald J Kimball <rjk@tamias.net> wrote:
This appears to be caused by the TRIE optimization (as far as I can tell) $ perl -Mre=debug -e'print (("ac" =~ /^(a(*THEN)b|ac)/)? "yes\n":"no\n")' Compiling REx "^(a(*THEN)b|ac)" This fails in the exact same manner: $ perl -Mre=debug -e'print (("ac" =~ /^((?:a(*THEN)b)|ac)/)? This succeeds: $ perl -Mre=debug -e'print (("ac" =~ /^((a(*THEN)b)|ac)/)? "yes\n":"no\n")' Compiling REx "^((a(*THEN)b)|ac)" |
From @khwilliamsonOn 01/25/2013 03:17 PM, Ronald J Kimball wrote:
I bisected this problem. The offending commit is tries: don't allocate memory at runtime This is an indirect fix for The trie runtime code was doing more SAVETMPS than FREETMPS and was The basic issue is that multiple branches in the trie may trigger an "abcd" =~ /xyz/abcd.*X|ab.*Y|/ here, words (branches) 2 and 3 are accept states. The original approach The new approach involves creating extra info at compile time; in q b c d (e.g. at state 1, if the next char is 'a', we transition to state 2). At run time we run the trie to completion, and remember the word Since we are no longer recording the end-position of each word in the This algorithm is optimised for the typical case where there are a This patch creates a new compile-time array, trie->wordinfo[], |
From @iabynOn Fri, Jan 25, 2013 at 04:47:48PM -0700, Karl Williamson wrote:
Oh joy. I'll add it to my list... -- |
Migrated from rt.perl.org#116537 (status was 'open')
Searchable as RT116537$
The text was updated successfully, but these errors were encountered: