title: regex to match a string and avoid an interval
body: <p>I am working in javascript/jquery and
  I have this STRING:
  (Notice that this is a STRING containing Html and so i can't just do $('.myClass').whatever :))</p>
  
  <p>"</p>
  
  <pre><code>&lt;div class="myClass"&gt; asd class 2 a a a a a a &lt;/div&gt;   class
  &lt;div class="myClass"&gt; class asd df &lt;/div&gt;
  &lt;div class="myClass"&gt; class &lt;/div&gt;
  &lt;div class="myClass"&gt; class sdf class aa &lt;/div&gt;
  &lt;div class="myClass"&gt;class sdf class aa &lt;/div&gt;
  </code></pre>
  
  <p>"</p>
  
  <p>i wanna make a regexp that matches only a certain word but not in the html tags.
  for example if my word is "class" i want to match this:
  (the [] enclosure is a match)
  "</p>
  
  <pre><code>&lt;div class="myClass"&gt; asd [class] 2 a a a a a a &lt;/div&gt;   class
  &lt;div class="myClass"&gt; [class] asd df &lt;/div&gt;
  &lt;div class="myClass"&gt; [class] &lt;/div&gt;
  &lt;div class="myClass"&gt; [class] sdf [class] aa &lt;/div&gt;
  &lt;div class="myClass"&gt;[class] sdf [class] aa &lt;/div&gt;
  </code></pre>
  
  <p>"
  and not this:
  (the [] enclosure is a match)
  "</p>
  
  <pre><code>&lt;div [class]="myClass"&gt; asd [class] 2 a a a a a a &lt;/div&gt;   class
  &lt;div [class]="myClass"&gt; [class] asd df &lt;/div&gt;
  &lt;div [class]="myClass"&gt; [class] &lt;/div&gt;
  &lt;div [class]="myClass"&gt; [class] sdf [class] aa &lt;/div&gt;
  &lt;div [class]="myClass"&gt;[class] sdf [class] aa &lt;/div&gt;
  </code></pre>
  
  <p>"
  someone can help me? :)</p>