title: Javascript - Regex rule, find XX but not in span tag
body: <p><strong>Text</strong></p>
  
  <pre><code>message = 'Hello, my name ist Peter!';
  </code></pre>
  
  <p><strong>My Tags</strong></p>
  
  <pre><code>tags = {}; 
  tags.tagsOne = {};
  tags.tagsOne['t1'] = 'hello|is|there|g';
  tags.tagsOne['t2'] = 'bub';
  tags.tagsOne['t3'] = 'dog|house';
  tags.tagsTwo = {}; 
  tags.tagsTwo['t1'] = 'blub|man';
  tags.tagsTwo['t2'] = 'word';
  tags.tagsTwo['t3'] = 'sorry|high';
  </code></pre>
  
  <p><strong>Regex</strong></p>
  
  <pre><code>regexT1 = new RegExp('('+tags.tagsOne['t1']+'|'tags.tagsTwo['t1']+')','gi');
  regexT2 = new RegExp('('+tags.tagsOne['t2']+'|'tags.tagsTwo['t2']+')','gi');
  regexT3 = new RegExp('('+tags.tagsOne['t3']+'|'tags.tagsTwo['t3']+')','gi');
  </code></pre>
  
  <p><strong>Replace</strong></p>
  
  <pre><code>message = message.replace(regexT1,'&lt;span class="highlightT1"&gt;$1&lt;/span&gt;');
  message = message.replace(regexT2,'&lt;span class="highlightT2"&gt;$1&lt;/span&gt;');
  message = message.replace(regexT3,'&lt;span class="highlightT3"&gt;$1&lt;/span&gt;');
  </code></pre>
  
  <p>He finds and replaces the <code>&lt;span class="highlightT1"&gt;$1&lt;/span&gt;</code> too.<br />
  Is it possible in regex to say, but not this -> <code>&lt;span class="highlightT1"&gt;$1&lt;/span&gt;</code></p>
  
  <p><strong>Example</strong><br />
  -> <a href="http://jsfiddle.net/tVmTe/3/" rel="nofollow">http://jsfiddle.net/tVmTe/3/</a></p>
  
  <p><strong>UPDATE:</strong><br />
  <strong>Working example</strong>
  -> <a href="http://jsfiddle.net/tVmTe/9/" rel="nofollow">http://jsfiddle.net/tVmTe/9/</a></p>