@@ 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 {<func1>}
my regex sparkling2 {
- <[abc]>?
[
- <func1>
- <func2>
- <func3>
- ]+
- <[def]>?
+ <func1>$|<func2>|<func3>
+ #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++;
}
}
+