 <p>for non GNU sed (or with <code>--posix</code> option) where <code>|</code> is not available</p> <p>If TGG is not occuring or could be included</p> <pre><code>sed 's/T[AG][AG]$//' YourFile </code></pre> <p>if not</p> <pre><code>sed 's/T[AG]A$//;s/TAA$//' YourFile </code></pre>