perl> $dna = "NNNNATCGNNNTCGANNN";; perl> $dna =~ s[^N*(.*?)N*$][$1];; perl> print $dna;; ATCGNNNTCGA