From 5fc85ca2f674acaf59e37b6be4aab8596f5ac44c Mon Sep 17 00:00:00 2001 From: terceranexus6 Date: Mon, 28 Nov 2022 14:50:02 +0100 Subject: [PATCH] I fixed the regex that wasn working --- sparkling_goblin.raku | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/sparkling_goblin.raku b/sparkling_goblin.raku index 6734051..490c34b 100644 --- a/sparkling_goblin.raku +++ b/sparkling_goblin.raku @@ -1,4 +1,3 @@ - #my functions sub MAIN (Str :$fi = '', Str :$fo = '') { # say "File is $fi"; @@ -15,29 +14,25 @@ sub MAIN (Str :$fi = '', Str :$fo = '') { # matching regex + # easy one for debug: my regex sparkling_goblin {} my regex sparkling2 { - <[abc]>? [ - - - - ]+ - <[def]>? + $|| + #func3\s + ] } # if needed #my rule sparkling_goblin {'' <>} - # reading the sample line by line from a binary file -# my $name = prompt "file name >"; +# reading the sample line by line from a binary file my $c = 1; for "$fo/$fi".IO.lines -> $line { # If the line contains the gene, print it - if $line ~~ &sparkling_goblin {say "Sparkling Goblin found: "; say $line; say "in line $c"; say "in file $fi"; say " "; } - #if $line ~~ &sparkling2 {say "Sparkling Goblin complex regex found: "; say $line; say "in line $c"; say " "; } - + if $line ~~ &sparkling2 {say "Sparkling Goblin complex regex found: "; say $line; say "in line $c"; say "in file $fi"; say " "; } $c++; } } + -- 2.38.5