$seq =~ s/-//g; # remove any dashes, first $seq =~ s/[ATGC]{2}/$&$tag/; $seq =~ s/$tag[ATGC]{4}/$&$tag/; #### $seq =~ s/-(?!-)//g;