in reply to finding position of first occurence of 3 different stopping criteria

You could try something like this:

my $seq = "012345678WW89YYabcdeZZ"; my $start = 'WW'; my @ends = qw (XX YY ZZ); my $end = '(' . join ( '|', @ends ) . ')'; if ( $seq =~ /$start.*?$end/ ) { print "start: $-[0] end: $-[1]"; }

dave

  • Comment on Re: finding position of first occurence of 3 different stopping criteria
  • Download Code