Is this a regex bug?

[email protected] (ToddAndMargo via perl6-users)
Newsgroups perl.perl6.users
Message-ID <[email protected]>
Hi All,

Fedora 37
RakudoPkgFedora37-2023.05.01.x86_64.rpm
https://github.com/nxadm/rakudo-pkg/releases

The `/$0$1 $2/` is not coming out correct.
Is this a bug or did I do something wrong?


Many thanks,
-T


$ curl -L http://vpaste.net/pxRm6 -o -
<RegexTest.pl6>
#!/bin/raku

print "\n";
my Str $x = Q[<a 
href="wike-2.0.1-1.fc38.noarch.rpm">wike-2.0.1-1.fc38.noarch.rpm</a> 
27-Apr-2023 01:53  143K] ~
             Q[<a 
href="wine-8.6-1.fc38.i686.rpm">wine-8.6-1.fc38.i686.rpm</a> 
19-Apr-2023 21:48  11K] ~
             Q[<a 
href="wine-8.6-1.fc38.x86_64.rpm">wine-8.6-1.fc38.x86_64.rpm</a> 
                 19-Apr-2023 21:48     11K] ~
             Q[<a 
href="wine-alsa-8.6-1.fc38.i686.rpm">wine-alsa-8.6-1.fc38.i686.rpm</a> 
  19-Apr-2023 21:48  223K] ~
             "\n\n";

$x~~s:i/  .*? ("wine")  (.*?)  $(Q[">] )  .*?  $( Q[a href="] )  (.*?) 
( $(Q[">] ) )  /$0$1 $2/;
print "0 = <$0>\n1 = <$1>\n2 = <$2>\n\n";
print "$x\n\n";
</RegexTest.pl6>


$ RegexTest.pl6

0 = <wine>
1 = <-8.6-1.fc38.i686.rpm>
2 = <wine-8.6-1.fc38.x86_64.rpm>

wine-8.6-1.fc38.i686.rpm 
wine-8.6-1.fc38.x86_64.rpmwine-8.6-1.fc38.x86_64.rpm</a> 
         19-Apr-2023 21:48     11K<a 
href="wine-alsa-8.6-1.fc38.i686.rpm">wine-alsa-8.6-1.fc38.i686.rpm</a> 
  19-Apr-2023 21:48  223K

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Computers are like air conditioners.
They malfunction when you open windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.