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
In reply to Re: finding position of first occurence of 3 different stopping criteria
by Not_a_Number
in thread finding position of first occurence of 3 different stopping criteria
by imlou
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |