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
5.10: different behaviour of duplicated named capturing parens with/without (?|...) #9130
Comments
From andy@shitov.ruThis is a bug report for perl from andy@shitov.ru, The resetting parens (?| ... ) in regexps wokr wrong when it is Here is an example: use feature 'say'; my $re = qr/ '20071122' =~ $re; 'November, 2007' =~ $re; It looks like $+{year} in the second match prints the $1 when first (\d{4}) (\d\d) (?<year>\d\d) When (?| ... ) is removed, the behaviour changes and the programme Flags: This perlbug was built using Perl 5.10.0 - Thu Nov 22 14:37:24 2007 Site configuration information for perl 5.8.8: Configured by SYSTEM at Tue Aug 29 12:39:43 2006. Summary of my perl5 (revision 5 version 8 subversion 8) configuration: Locally applied patches: @INC for perl 5.8.8: Environment for perl 5.8.8: |
From @rgsOn 24/11/2007, via RT Andrew wrote:
This doesn't look very difficult to fix, but for 5.10.0, since we're |
The RT System itself - Status changed from 'new' to 'open' |
From @demerphqOn Nov 24, 2007 11:01 AM, Rafael Garcia-Suarez <rgarciasuarez@gmail.com> wrote:
I concur, and actually off the top of my head I can't see an easy solution. Named captures are implemented as maps to one or more numbered capture OPEN1 ---> buffer index So what happens is that with the two combined you get something like: open1 year->1,2 Thus in the "incorrect case" if the OP dumps $-{year} he should get Without the branch reset the program ends up looking like: open1 year->1,3 And thus $+{year} will have the correct value. So id say we document this mixture as "probably best avoided, but if IMO its most definately not something that can be changed in time for release. yves -- |
From @bulk88On Sat Nov 24 04:49:14 2007, demerphq wrote:
5.10 is out of support now. Does anything in this bug still apply today This bug also lists Win32 as the OS due to the perlbug data, but its not -- |
From @demerphqOn 27 December 2012 03:08, bulk88 via RT <perlbug-followup@perl.org> wrote:
This bug is still around in blead. Its close to but not quite a It has nothing to do with win32 please feel free to assign the bug to me. Yves -- |
This should be fixed by #20653 |
Migrated from rt.perl.org#47762 (status was 'open')
Searchable as RT47762$
The text was updated successfully, but these errors were encountered: