Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If I understand correctly:</p> <p>1) Start with ATG</p> <p>2) A number of triplets, except 'TAG', 'TAA', and 'TGA'</p> <p>3) One of the triplets 'TAG', 'TAA', or 'TGA'</p> <p>This should work:</p> <pre><code>/ (ATG) # Step 1 ((?!TAG|TAA|TGA)[ACGT]{3})+ # Step 2 (TAG|TAA|TGA) # Step 3 /x </code></pre> <p>The difference from you second idea it to move the negative look-ahead inside the quantifier to get 'a number of triplet' step ensuring that neither of the triplets are one of the exceptions</p> <p>This solution does not assume any commonality between the elements in step 2 and step 3. A simpler, but in your case equivalent, formulations would be:</p> <p>1) Match 'ATG'</p> <p>2) Match a number of triplets</p> <p>3) ... until you match 'TAG', 'TAA', 'TGA'.</p> <p>To do this you just need to make the quantifier in step 2 non-greedy, as this would test is Step 3 matches before trying if step 2 matched again.</p> <p>Then the solution would look like:</p> <pre><code>/ (ATG) ([ACGT]{3})*? (TAG|TAA|TGA) /x </code></pre> <p>An alternative interpretation might be:</p> <p>1) Start with ATG</p> <p>2) A number of triplets</p> <p>3) One of the triplets 'TAG', 'TAA', 'TGA'</p> <p>4) The substring found in step 2 must not contain the substrings 'TAG', 'TAA', 'TGA'.</p> <p>In this case I would solve it using two regular expressions. On implementing step 1-3 and one for the test in step 4:</p> <pre><code> $sequence =~ /(ATG)([ACGT]{3})(TAG|TAA|TGA)/ and $2 !~ /TAG|TAA|TGA/; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload