in reply to Re: regexp g option: finds all occurrences? ha!!
in thread regexp g option: finds all occurrences? ha!!

Amazingly, one of the solutions worked perfectly.

my $regexp = "..g.{18}c"; my @antisense_oligos; $_ = $input_seq; do{ push @antisense_oligos, $1 if (m/^($regexp)/) } while ( s/^.// ); $,="\n"; print @antisense_oligos;


When I get the chance, I'll try to put pos() to work.

Thank you!!!

Replies are listed 'Best First'.
Re: Re: Re: regexp g option: finds all occurrences? ha!!
by waswas-fng (Curate) on Oct 12, 2003 at 23:17 UTC
    Another way you may find quicker depending on how large your input string is is to use substr to nibble N chars at a time and then use the next pos to grab the next group of chars. This should be fairly speedy with little of the overhead of the above.


    -Waswas