<?xml version="1.0" encoding="windows-1252"?>
<node id="960200" title="Re: Modification of read only values." created="2012-03-17 15:09:45" updated="2012-03-17 15:09:45">
<type id="11">
note</type>
<author id="634253">
AnomalousMonk</author>
<data>
<field name="doctext">
&lt;p&gt;
In addition, the inverted character set &lt;c&gt; [^TAG|TAA|TGA] &lt;/C&gt; in the OP regex does not do what I think you think it does. The | (pipe) character has no special meaning in a character set, nor does repetition of a character have significance. The set above is equivalent to the &lt;c&gt; [^|TAG] &lt;/C&gt; set.
&lt;/P&gt;

&lt;p&gt;
My guess about what you originally intended is something along the lines of "not followed by any of the sub-sequences TAG, TAA or TGA". This can be achieved by the negative look-ahead assertion &lt;br&gt;
&lt;c&gt;    (?! TAG | TAA | TGA)&lt;/c&gt; &lt;br&gt; 
(assuming use of the [doc://perlre#x|/x] regex modifier).
&lt;/P&gt;

&lt;p&gt;
However, the original expression was &lt;c&gt; [^TAG|TAA|TGA]? &lt;/C&gt; (or its equivalent &lt;c&gt;[^|TAG]?&lt;/C&gt;) &amp;mdash; note the ? quantifier &amp;mdash; meaning "Some character other than &lt;c&gt; | T A G &lt;/C&gt; &lt;i&gt;must&lt;/I&gt; be present &amp;mdash; or not. Whatever." The ? quantifier makes the whole thing optional either in its character set form or as a negative look-ahead.
&lt;/P&gt;

&lt;p&gt;
On The Other Hand, the OP m// regex used the [doc://perlre#g-and-c|/g] modifier, so the intent may have been something like "&lt;i&gt;step over&lt;/I&gt; any three bases other than a TAG, TAA or TGA sub-sequence, if present", which could be achieved by &lt;br&gt;
&lt;c&gt;    (?: (?! TAG | TAA | TGA) ...)?&lt;/c&gt; &lt;br&gt; 
(again, with the /x modifier), but this is reading a lot into [Ekolet]'s OP.
&lt;/P&gt;

&lt;p&gt;
&lt;b&gt;Update:&lt;/B&gt; Furthermore, the &lt;c&gt; \w+[^ATG]? &lt;/C&gt; sub-expression is suspect. I don't understand the intention of this one either if one assumes matching against a string consisting only of A T C G characters or, more generally, only \w characters; in either case, the &lt;c&gt; \w+ &lt;/C&gt; will 'consume' anything that might be matched by the optional &lt;c&gt; [^ATG]? &lt;/C&gt; which is thus rendered effectless.
&lt;/P&gt;
</field>
<field name="root_node">
960195</field>
<field name="parent_node">
960195</field>
</data>
</node>
