~alienagain/curious_butterfly

5fc85ca2f674acaf59e37b6be4aab8596f5ac44c — terceranexus6 3 months ago 764619f
I fixed the regex that wasn working
1 files changed, 7 insertions(+), 12 deletions(-)

M sparkling_goblin.raku
M sparkling_goblin.raku => sparkling_goblin.raku +7 -12
@@ 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++;
    }

}