title: RegExp case insensitive multi word highlight
body: <p>I am trying to get highlighting on keyword searching working right. A couple issues I am having.</p>
  
  <ol>
  <li>Case insensitive is working for the first word, but would like it to replace with original case word, not the lowercase searched word.</li>
  </ol>
  
  <p>i.e. search trend, it replaces Trend with trend, I know why, but would like to figure out how to replace back the found word, not the searched word</p>
  
  <ol start="2">
  <li>The second word is not matching case insensitive.</li>
  </ol>
  
  <p>i.e. search trend micro is not matching trend Micro.</p>
  
  <p>Here is jsFiddle: <a href="http://jsfiddle.net/hh2zvjft/1/" rel="nofollow noreferrer">http://jsfiddle.net/hh2zvjft/1/</a></p>
  
  <pre><code>if ($(".ProjectSearch").val().length &gt; 0) {
      var searchedText = $(".ProjectSearch").val();
      var wordList = searchedText.split(" ");
      $.each(wordList, function (i, word) {
          $(".ProjectTaskGrid:contains('" + word + "')").each(function (i, element) {
              var rgxp = new RegExp(word, "gi");
              var repl = '&lt;span class="search-found"&gt;' + word + '&lt;/span&gt;';
              element.innerHTML = element.innerHTML.replace(rgxp, repl);
          });
      });
  }
  </code></pre>
  
  <p>Can you please help identify the issues, and offer improvements? Thanks!</p>
  
  <p>Some refererences used to arrive at code:</p>
  
  <p><a href="https://stackoverflow.com/a/120161/2727155">https://stackoverflow.com/a/120161/2727155</a></p>
  
  <p><a href="https://stackoverflow.com/a/10011639/2727155">https://stackoverflow.com/a/10011639/2727155</a></p>