Re: Wierd regex

[email protected] (Timo Paulssen via perl6-users) Tue, 3 Mar 2026 16:35:19 +0100
Newsgroups perl.perl6.users
Message-ID <[email protected]>
Hi Todd,

did you accidentally change more than just the sleep and print commands, 
or did you give us an older version of the code that you ran?

I spot a difference where the code that doesn't work has "Icedrive" and 
the one that does work has "drive", and the thing you're trying to match 
against seems to have "drive" and not "Icedrive".

Hope that helps,
   - Timo


On 3/3/26 03:28, ToddAndMargo via perl6-users wrote:
> Hi All,
>
> Fedora 43
> RakudoPkgFedora43-01.01.x86_64.rpm
>
> This regex does not work:
>
>          $NewRev  = $RunResult.stdout;
>          # <meta name="description" content="Download drive 3.56 - 
> Back up and access your files">
>          $NewRev ~~ s/ .*? $( Q[Download Icedrive ] ) //;
>          $NewRev ~~ s/ $( Q[ ] ) .* //;
>          if $NewRev.chars > 40  { $NewRev = 0; }
>
> Way to many characters.
>
>
> But this does:
>
>          $NewRev  = $RunResult.stdout;
>          # <meta name="description" content="Download drive 3.56 - 
> Back up and access your files">
>          sleep .2;
>          $NewRev ~~ s/ .*? $( Q[Download drive ] ) //;
>          sleep .2;
>          $NewRev ~~ s/ $( Q[ ] ) .* //;
>          sleep .2;
>          if $NewRev.chars > 40  { $NewRev = 0; }
>
>
> The sleep statements were originally debugging print statements.
> The above worked when the print statement were active but
> not when I commented them out.  So I substituted sleep for
> print and it still worked.
>
> What the ....
>
> Yours in Confusion,
> -T