Skip Menu |
Report information
Id: 122090
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: mauke- <l.mai [at] web.de>
Cc:
AdminCc:

Operating System: (no value)
PatchStatus: (no value)
Severity: low
Type: unknown
Perl Version: (no value)
Fixed In: 5.22.0



Subject: Non-word-boundary doesn't match EOS in 5.20
Download (untitled) / with headers
text/plain 650b
With 5.20: C:\>perl -v This is perl 5, version 20, subversion 0 (v5.20.0) built for MSWin32-x64-multi-thread ... C:\>perl -wE "q{} =~ /\B/ or die" Died at -e line 1. ----------------------------------------------- With 5.10 / 5.12: $ perl -wE "q{} =~ /\B/ or die" $ I don't have 5.14/5.16/5.18 here to test. I think the 5.10/5.12 behavior is correct: beginning-of-string/end-of-string count as non-word-characters for \b and \B. The empty string "" has a non-word-boundary between beginning-of-string and end-of-string (both virtual \W). Was this an intentional change in 5.20? I've skimmed the perldeltas but haven't found anything related.
Subject: Re: [perl #122090] Non-word-boundary doesn't match EOS in 5.20
To: perl5-porters [...] perl.org
Date: Thu, 12 Jun 2014 20:12:07 +0200
From: Dennis Kaarsemaker <dennis [...] kaarsemaker.net>
Download (untitled) / with headers
text/plain 1.1k
On do, 2014-06-12 at 08:27 -0700, via RT wrote: Show quoted text
> # New Ticket Created by l.mai@web.de > # Please include the string: [perl #122090] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org/Ticket/Display.html?id=122090 > > > > With 5.20: > > C:\>perl -v > > This is perl 5, version 20, subversion 0 (v5.20.0) built for MSWin32-x64-multi-thread > > ... > > C:\>perl -wE "q{} =~ /\B/ or die" > Died at -e line 1. > > ----------------------------------------------- > > With 5.10 / 5.12: > $ perl -wE "q{} =~ /\B/ or die" > $ > > I don't have 5.14/5.16/5.18 here to test. > > I think the 5.10/5.12 behavior is correct: beginning-of-string/end-of-string count as non-word-characters for \b and \B. The empty string "" has a non-word-boundary between beginning-of-string and end-of-string (both virtual \W). > > Was this an intentional change in 5.20? I've skimmed the perldeltas but haven't found anything related.
It changed in 5.14: $ perl -v | grep subv This is perl 5, version 14, subversion 2 (v5.14.2) built for x86_64-linux $ perl -wE "q{} =~ /\B/ or die" Died at -e line 1. -- Dennis Kaarsemaker www.kaarsemaker.net
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1.3k
On Thu Jun 12 11:12:33 2014, dennis@kaarsemaker.net wrote: Show quoted text
> On do, 2014-06-12 at 08:27 -0700, via RT wrote:
> > # New Ticket Created by l.mai@web.de > > # Please include the string: [perl #122090] > > # in the subject line of all future correspondence about this issue. > > # <URL: https://rt.perl.org/Ticket/Display.html?id=122090 > > > > > > > With 5.20: > > > > C:\>perl -v > > > > This is perl 5, version 20, subversion 0 (v5.20.0) built for MSWin32- > > x64-multi-thread > > > > ... > > > > C:\>perl -wE "q{} =~ /\B/ or die" > > Died at -e line 1. > > > > ----------------------------------------------- > > > > With 5.10 / 5.12: > > $ perl -wE "q{} =~ /\B/ or die" > > $ > > > > I don't have 5.14/5.16/5.18 here to test. > > > > I think the 5.10/5.12 behavior is correct: beginning-of-string/end- > > of-string count as non-word-characters for \b and \B. The empty > > string "" has a non-word-boundary between beginning-of-string and > > end-of-string (both virtual \W). > > > > Was this an intentional change in 5.20? I've skimmed the perldeltas > > but haven't found anything related.
> > It changed in 5.14: > > $ perl -v | grep subv > This is perl 5, version 14, subversion 2 (v5.14.2) built for x86_64- > linux > $ perl -wE "q{} =~ /\B/ or die" > Died at -e line 1.
Confirmed: ##### [~] 15 $ perlbrew use perl-5.14.4 [~] 16 $ perl -wE "q{} =~ /\B/ or die" Died at -e line 1. #####
From: Karl Williamson <public [...] khwilliamson.com>
Date: Thu, 12 Jun 2014 17:33:31 -0600
CC: perl5-porters [...] perl.org
To: perlbug-followup [...] perl.org, "OtherRecipients of perl Ticket #122090:;" [...] smtp.indra.com
Subject: Re: [perl #122090] Non-word-boundary doesn't match EOS in 5.20
Download (untitled) / with headers
text/plain 1.1k
On 06/12/2014 04:41 PM, James E Keenan via RT wrote: Show quoted text
> On Thu Jun 12 11:12:33 2014, dennis@kaarsemaker.net wrote:
>> On do, 2014-06-12 at 08:27 -0700, via RT wrote:
>>> # New Ticket Created by l.mai@web.de >>> # Please include the string: [perl #122090] >>> # in the subject line of all future correspondence about this issue. >>> # <URL: https://rt.perl.org/Ticket/Display.html?id=122090 > >>> >>> >>> With 5.20: >>> >>> C:\>perl -v >>> >>> This is perl 5, version 20, subversion 0 (v5.20.0) built for MSWin32- >>> x64-multi-thread >>> >>> ... >>> >>> C:\>perl -wE "q{} =~ /\B/ or die" >>> Died at -e line 1. >>> >>> ----------------------------------------------- >>> >>> With 5.10 / 5.12: >>> $ perl -wE "q{} =~ /\B/ or die" >>> $ >>>
I bisected it to 63ac0dadb1aafcf0c171d3c1422c1923b611b2fc is the first bad commit commit 63ac0dadb1aafcf0c171d3c1422c1923b611b2fc Author: Karl Williamson <public@khwilliamson.com> Date: Tue Dec 28 16:13:49 2010 -0700 regex: Use BOUNDU regnodes This refactors one area in regexec.c to use BOUNDU, NBOUNDU for efficiciency, and easier adding of the future BOUNDA. bisect run success That took 1097 seconds
Date: Wed, 18 Jun 2014 20:51:20 -0600
Subject: Re: [perl #122090] Non-word-boundary doesn't match EOS in 5.20
From: Karl Williamson <public [...] khwilliamson.com>
To: "perlbug-followup [...] perl.org" <perlbug-followup [...] perl.org>
Download (untitled) / with headers
text/plain 1.1k
On 06/12/2014 09:27 AM, l.mai@web.de (via RT) wrote: Show quoted text
> # New Ticket Created by l.mai@web.de > # Please include the string: [perl #122090] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org/Ticket/Display.html?id=122090 > > > > With 5.20: > > C:\>perl -v > > This is perl 5, version 20, subversion 0 (v5.20.0) built for MSWin32-x64-multi-thread > > ... > > C:\>perl -wE "q{} =~ /\B/ or die" > Died at -e line 1. > > ----------------------------------------------- > > With 5.10 / 5.12: > $ perl -wE "q{} =~ /\B/ or die" > $ > > I don't have 5.14/5.16/5.18 here to test. > > I think the 5.10/5.12 behavior is correct: beginning-of-string/end-of-string count as non-word-characters for \b and \B. The empty string "" has a non-word-boundary between beginning-of-string and end-of-string (both virtual \W). > > Was this an intentional change in 5.20? I've skimmed the perldeltas but haven't found anything related. >
Is this a distillation of a more complex example? If so, please give me that, or something somewhat more complex than this one. (I'm tempted to make a special case for the empty string, but shouldn't do that if this problem occurs for non-empty strings)
Date: Thu, 19 Jun 2014 09:47:08 -0400
Subject: Re: [perl #122090] Non-word-boundary doesn't match EOS in 5.20
From: Eric Brine <ikegami [...] adaelis.com>
CC: "perlbug-followup [...] perl.org" <perlbug-followup [...] perl.org>
To: Karl Williamson <public [...] khwilliamson.com>
Download (untitled) / with headers
text/plain 494b
On Wed, Jun 18, 2014 at 10:51 PM, Karl Williamson <public@khwilliamson.com> wrote:
Show quoted text
Is this a distillation of a more complex example?  If so, please give me that, or something somewhat more complex than this one.  (I'm tempted to make a special case for the empty string, but shouldn't do that if this problem occurs for non-empty strings)

$ perl -wE 'say "..." =~ s/\B/!/rg or die'
!.!.!.

I would expect

$ perl -wE 'say "..." =~ s/(?<=\w)(?=\w)|(?<!\w)(?!\w)/!/rg or die'
!.!.!.!

To: Eric Brine <ikegami [...] adaelis.com>
CC: Karl Williamson <public [...] khwilliamson.com>, "perlbug-followup [...] perl.org" <perlbug-followup [...] perl.org>
Date: Thu, 19 Jun 2014 19:33:26 +0200
Subject: Re: [perl #122090] Non-word-boundary doesn't match EOS in 5.20
From: Eirik Berg Hanssen <Eirik-Berg.Hanssen [...] allverden.no>
Download (untitled) / with headers
text/plain 1.3k
On Thu, Jun 19, 2014 at 3:47 PM, Eric Brine <ikegami@adaelis.com> wrote:
Show quoted text
On Wed, Jun 18, 2014 at 10:51 PM, Karl Williamson <public@khwilliamson.com> wrote:
Is this a distillation of a more complex example?  If so, please give me that, or something somewhat more complex than this one.  (I'm tempted to make a special case for the empty string, but shouldn't do that if this problem occurs for non-empty strings)

$ perl -wE 'say "..." =~ s/\B/!/rg or die'
!.!.!.

I would expect

$ perl -wE 'say "..." =~ s/(?<=\w)(?=\w)|(?<!\w)(?!\w)/!/rg or die'
!.!.!.!

  Huh.  It does match, if part of an alternation, even with a never-matching pattern:

 eirik@greencat[19:24:16]~$ perl -wE 'say "..." =~ s/\B/!/rg or die'
!.!.!.
eirik@greencat[19:24:19]~$ perl -wE 'say "..." =~ s/(?!)/!/rg or die'
...
eirik@greencat[19:24:21]~$ perl -wE 'say "..." =~ s/\B|(?!)/!/rg or die'
!.!.!.!
eirik@greencat[19:24:22]~$


  Ah, yes; this was "for efficiency", right?  The alternation probably rules out that "for efficiency" alternative. :)


  Still, I figured I'd share, just in case it helps.

  For {the record,your information,fun}, I found this while playing around with \B (I never used it before):

eirik@greencat[19:29:28]~$ perl -wE 'say "..foo.." =~ s/\B|(\b)/defined($1)?"=":"!"/erg or die'
!.!.=f!o!o=.!.!
eirik@greencat[19:29:31]~$


Eirik
RT-Send-CC: perl5-porters [...] perl.org
Thanks for finding this Fixed by c8519dc797997ef2e60f58f25157026584a20c1e -- Karl Williamson
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 121b
Reopening so I can change the resolution to what I should have made it to begin with: Pending release -- Karl Williamson
Subject: Your ticket against Perl 5 has been resolved
Download (untitled) / with headers
text/plain 222b
Thanks for submitting this ticket The issue should be resolved with the release today of Perl v5.22. If you find that the problem persists, feel free to reopen this ticket -- Karl Williamson for the Perl 5 porters team


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org