On 06/12/2018 05:47 PM, Timo Paulssen wrote:
My recommendations:

     if $line.contains(all("wine-patched/archive/staging-/", ".tar.gz")){ }

     # if the path has to be at the beginning and the extension at the end,
     # which your original regex doesn't require, but it's probably right
     if $line.starts-with("wine-patched/archive/staging-/") &&
$line.ends-with(".tar.gz") { }

     if $line ~~ m{ "wine-patched/archive/staging-/" .* ".tar.gz" } { }

What do you think?
   - Timo

I like it.

I used

$ p6 'my $Line = "wine-patched/archive/staging-/xxxxx.tar.gz";if $Line ~~ m| "wine-patched/archive/staging-/" .*? ".tar.gz" | {say "yes"} else {say "no"};'

as it insures the patterns are in sequence, not random.

Thank you!

Reply via email to