title: How to exclude a specific pattern from regex in perl?
body: <p>I have a little trouble with a regular expression. I have the following one: <code>(A|C|G|T){3}</code> which gives every permutation of three letters from A,B,C,D but now I want to exclude three specific patterns: <code>"TAG"</code>, <code>"TAA"</code> and <code>"TGA"</code> . Tried with <code>[^]</code>, but it is not yielding expected results. Same goes using <a href="http://www.perlmonks.org/?node_id=518444" rel="nofollow">look-around</a>(look ahead and look-behind).</p>
  
  <p>What I am trying to achieve is to find all sub-strings who start with "ATG", end with either  "TAG", "TAA" or "TGA" and in the middle it should have triples of A,C,G or T.</p>
  
  <p>Thanks for the help!</p>
  
  <p>Here is what I have done so far:</p>
  
  <pre><code>(ATG)((((A|C|G|T)){3})[^TAG][^TAA][^TGA])*(TAG|TAA|TGA)
  
  (ATG)((?!TAG)(?!TAA)(?!TGA)(((A|C|G|T)){3})*)(TAG|TAA|TGA)
  </code></pre>