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
$1 not set properly on backtrack #7407
Comments
From japhy@perlmonk.orgCreated by japhy@perlmonk.orgUpon backtracking, "ABCDE" =~ m{ This should print <ABCDE> 0..5 But instead it prints <ABCDE> 0..5 Perl Info
|
From @hvds"japhy@perlmonk.org (via RT)" <perlbug-followup@perl.org> wrote: It is arguable that you should not make assumptions about internal However, I think this represents a genuine bug, since an attempt to Strangely, replacing (.+) with (.+?) does allow it to match. Hugo |
The RT System itself - Status changed from 'new' to 'open' |
From japhy@pobox.comOn Jul 7, Hugo van der Sanden via RT said:
I know *why* the problem is caused. Here is an example using this Matching REx `(?:(.+)){2}' against `abc' HERE, we have matched once, and (.+) absorbed the whole string. 3 <abc> <> | 3: OPEN1 Now we re-open $1... 3 <abc> <> | 5: PLUS ...and close it here, to the LEFT of where we opened it. 2 <ab> <c> | 9: WHILEM The problem is that the backtracking is not restoring PL_regstartp[1] (or -- |
From @khwilliamsonThis was fixed by: make S_regmatch() iterative rather than recursive. -- |
@khwilliamson - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#30608 (status was 'resolved')
Searchable as RT30608$
The text was updated successfully, but these errors were encountered: