change part of the string with case sensitive
<p>I would like the search a string without case sensitive however change  the sub string with original string's case letters.</p>

<pre><code>var mystring = "FiRst Last";
var term = "first";  // it could be "FIRST" or fIRST

var re = new RegExp("^" + term, "i") ;
//option 1
//var t = mystring.replace(re,"&lt;span style='font-weight:bold; color:Blue;'&gt;" + term + "&lt;/span&gt;");
//option 2
var t = mystring.replace(re,term.bold().fontcolor("Blue"));
</code></pre>

<p>The above code gives  <strong>first</strong> LAST  in blue color, however i want it to be <strong>FiRst</strong> LAST as mystring's case order</p>

<p>maybe indexof() method can be used however there might be an easy efficient way.</p>
