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
Recursive back references do not always work #10073
Comments
From ph10@hermes.cam.ac.ukConsider the pattern ^(xa|=?\1a){2}$ when matched against the string "xa=xaaa". Perl (apparently) backtracks into the second iteration of the group, to the So, the whole match succeeds with $1 set to "=xaaa". However, it should fail. One way of thinking about this is to consider the pattern without the question I discovered this bug because somebody reported exactly the same effect in Philip -- |
From @jkeenanOn Mon Jan 11 07:56:52 2010, ph10@hermes.cam.ac.uk wrote:
1. Do you get the same problems if you use the '\g1' or '\g{1}' notation 2. Have we ever claimed (in our documentation) that "recursive Thank you very much. |
The RT System itself - Status changed from 'new' to 'open' |
From @hvds"James E Keenan via RT" <perlbug-followup@perl.org> wrote: If the string were "xa=xaa" then it would make sense to look to the docs % perl -wle 'print "not ok" if "xa=xaaa" =~ /^(xa|=?\1a){2}$/' Hugo |
From @druud62On 2013-02-24 08:37, hv@crypt.org wrote:
I think this should compile \1 as \x{01}, -- |
From ph10@hermes.cam.ac.ukOn Sat, 23 Feb 2013, James E Keenan via RT wrote:
Yes in both cases, with Perl 5.016002. Exactly the same behaviour in all
I have no idea on your documentation question, I'm afraid. Regards, -- |
From @demerphqOn 24 February 2013 08:37, <hv@crypt.org> wrote:
Agreed. I consider this a bug, and time permitting will look into it. Yves -- |
@demerphq ping |
This seems like the bug about not resetting capture buffers after a failed alternation: #16616 |
I just checked into this again, what is happening is that it is not restoring the value of the capture buffer as it renters the while loop after a failed tail (B pattern). I will dig more. This might need some guidance from @iabyn |
Migrated from rt.perl.org#72020 (status was 'open')
Searchable as RT72020$
The text was updated successfully, but these errors were encountered: