title: Wrap character in String, excluding a Link tag with Javascript Regex
body: <p>EDIT</p>
  
  <p>heres what i have to do...</p>
  
  <p>Imagine if i have a text with some html tags inside it (it is still a string):</p>
  
  <pre><code>var string = '&lt;p&gt;Hello, my name is Mauricio&lt;/p&gt;&lt;p&gt;Hi, my name is Patricia&lt;/p&gt;&lt;p class="warn"&gt;Yeah, My name is Carl&lt;/p&gt;&lt;a href="#"&gt;&lt;img src="#" /&gt;&lt;/a&gt;';
  </code></pre>
  
  <p>And i want to wrap all the letters "a" with</p>
  
  <pre><code> &lt;span class="ui-match"&gt;&lt;/span&gt;
  </code></pre>
  
  <p>but i must not replace anything from the  tag, neither what is inside it, neither the class in the <p> element.</p>
  
  <p>So if I want to wrap all the letters "a" from that string, it would return like that:</p>
  
  <pre><code>&lt;p&gt;Hello, my n&lt;span class="ui-match"&gt;a&lt;/span&gt;me is M&lt;span class="ui-match"&gt;a&lt;/span&gt;uricio&lt;/p&gt;&lt;p&gt;Hi, my n&lt;span class="ui-match"&gt;a&lt;/span&gt;me is P&lt;span class="ui-match"&gt;a&lt;/span&gt;trici&lt;span class="ui-match"&gt;a&lt;/span&gt;&lt;/p&gt;&lt;p class="warn"&gt;Ye&lt;span class="ui-match"&gt;a&lt;/span&gt;h, My n&lt;span class="ui-match"&gt;a&lt;/span&gt;me is C&lt;span class="ui-match"&gt;a&lt;/span&gt;rl&lt;/p&gt;&lt;a href="#"&gt;&lt;img src="#" /&gt;&lt;/a&gt;
  </code></pre>
  
  <p>all the letters "a" where wrapped with </p>
  
  <pre><code> &lt;span class="ui-match"&gt;&lt;/span&gt;
  </code></pre>
  
  <p>, but the link and the paragraph were not.</p>
  
  <p>also this string is comming from a API, so its dynamic... this letter i'm searching is dynamic, so it can be "a" or "abc"... it must not be case sensitive</p>
  
  <p>thanks</p>