in reply to Multiple Regex's on a Big Sequence

Combiming the patterns looks easy, And if you need to run diffence code for differnt patterns put them in a hash with the pattern as the key and the coderef as the value.
use Regexp::Assemble; my @search_patterns = ( 'CACGTG', 'GTGCAC' ); my $ra = Regexp::Assemble->new; $ra->add( @search_patterns ); while ( $seq =~ /$ra/g ) { ... }
Boris

Replies are listed 'Best First'.
Re^2: Multiple Regex's on a Big Sequence
by bernanke01 (Beadle) on Aug 16, 2006 at 15:32 UTC
    Ahh, never heard of this module, that's cool! The one thing I should have mentioned is that I'm on a multi-processor system so a reg-ex or index approach might be more parallelizable. I think I should benchmark all the options though.