Help for this page

Select Code to Download


  1. or download this
    $seq =~ s{
      ([^U])  (?# anything other than U can be the "bracketing" character)
      (U+)    (?# match one or more Us)
    ...
      # with an equal number of copies of the bracketing character
      $1 x (1 + length($2))
    }xeg;  # replace all embedded sequences of Us in one go
    
  2. or download this
    $seq =~ s{^(U+)}{"I" x length($1)}eg;
    $seq =~ s{(U+)$}{"O" x length($1)}eg;