ignoring fuzzy match and add exact wrd pattern matching using javascript
<p>I am trying to create a text highlight option for my website. But I want exact word match instead of fuzzy word match, The code that I have matches all kind of instances and it has some case sensitivity issues. If we take the Jfiddle example, I only want to add the word cancer, case sensitivity should nt be an issue. and ignore fuzzy matches, like cancerous and bycanceraous(I know there is nt a wrd like that, bt could nt think of any for the example). I have the jfiddle link
<a href="http://jsfiddle.net/ehzPQ/6/" rel="nofollow">http://jsfiddle.net/ehzPQ/6/</a></p>

<p>HTML:</p>

<pre><code>&lt;div id="entity"&gt;cancer&lt;/div&gt;
&lt;div id="article"&gt;
  This kind of insurance is meant to supplement health insurance for cancerous-care costs. But generally you're better off putting your money toward comprehensive health policies. The I just repeat health insurance, because it sounds so good! health insurance, health insurance, I can never grow tired of it... Cancer is seriosuly a dangerouse disease. Test case : bycanceraous
&lt;/div&gt;​
</code></pre>

<p>CSS:</p>

<pre><code>.highlight {
    background-color: yellow
}​
</code></pre>

<p>Javascript:</p>

<pre><code>$(document).ready(function(){
  var $test = $('#article');
  var entityText = $('#entity').html();
  var entityRegularExpression = new RegExp(entityText,"g");
  var highlight = '&lt;span class="highlight"&gt;' + entityText + '&lt;/span&gt;';
  $test.html($test.html().replace(entityRegularExpression, highlight));
});
</code></pre>
