title: How to match the spefic fields excludes the contents wrapped in html tags?
body: <p>I have a large full-text content to handle,which the function is to search the spefic fields,and the results should be high-light.
  Here is my way below for example.</p>
  <pre><code>var content = '&lt;p style=&quot;font-size:11px;&quot;&gt;This is the content.123&lt;/span&gt;'
  var keyword = '1';
  var Reg = new RegExp(keyword, 'g')
  var content = content.replace(keyword, function (match) {
      match = match.replace(Reg, `&lt;span style=&quot;color: red;&quot;&gt;${keyword}&lt;/span&gt;`)
      return match;
  })
  </code></pre>
  <p>The result I get is like</p>
  <pre><code>&lt;p style=&quot;font-size:&lt;span style=&quot;color: red;&quot;&gt;1&lt;/span&gt;1px;&quot;&gt;This is the content.123&lt;/span&gt;
  </code></pre>
  <p>Obviously not what I want.</p>
  <p>So my question is how to match the spefic fields excludes the contents wrapped in  html tags?
  And the content may be much more complex than the example i made.</p>