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
*COMMIT etc in subroutines #16645
Comments
From ph10@hermes.cam.ac.ukCreated by ph10@cam.ac.ukThe Perl documentation says these things: (1) When discussing subroutine calls such as (?1): "Treat the contents of a (2) When discussing (*ACCEPT): "When inside of a nested pattern, such as $ perl -e 'if (ab =~ /(?1)b(?(DEFINE)(a(*ACCEPT)z))/) { print "yes >$&<\n"; } else { print "no \n"; }' In this example (?1) is successful, so it goes on to match "b"; it does not I couldn't find any statement about what happens when (*COMMIT), (*PRUNE), $ perl -e 'if (ac =~ /(?1)(a(*COMMIT)b)|ac/) { print "yes >$&<\n"; } else { print "no \n"; }' If (*COMMIT) had just caused (?1) to fail, there should have been a backtrack FYI: PCRE does restrict (*COMMIT), (*PRUNE), (*SKIP), and (*THEN) to act only If the current behaviour of (*COMMIT) etc. is what is intended, it would be I hope that is all clear. Thanks for your attention. Regards, Perl Info
|
From @jkeenanOn Tue, 24 Jul 2018 15:43:57 GMT, ph10@hermes.cam.ac.uk wrote:
To focus in on just this documentation piece: Could you provide a patch for the Perl documentation? Also, could you provide a link to the PCRE documentation and, perhaps, an illustration of how this works in PCRE?
Thank you very much. |
The RT System itself - Status changed from 'new' to 'open' |
From ph10@hermes.cam.ac.ukOn Mon, 3 Sep 2018, James E Keenan via RT wrote:
I don't know what form would be best for sending patches to Perl Note that this pattern does not behave the same way as the equivalent PCRE or Note that this pattern does not behave the same way as the equivalent Python The documentation for the current PCRE release is here: http://www.pcre.org/current/doc/html/ I have done a bit of editing on the documentation for the next release, "Backtracking verbs in subroutines" These behaviours occur whether or not the subpattern is called recursively. (*ACCEPT) in a subpattern called as a subroutine causes the subroutine match to (*FAIL) in a subpattern called as a subroutine has its normal effect: it forces (*COMMIT), (*SKIP), and (*PRUNE) cause the subroutine match to fail when (*THEN), when triggered, skips to the next alternative in the innermost I hope this helps. Regards, -- |
From @demerphqThis is on my todo list to review. But i am very busy. Yves
-- |
Migrated from rt.perl.org#133405 (status was 'open')
Searchable as RT133405$
The text was updated successfully, but these errors were encountered: