jQuery: find and replace cleaner syntax with jQuery? and advanced find/replace capabilities?
<p>So i got this snippet of code:</p>

<pre><code>$(document).ready(function () {
     var replacementDoneIn = $("body").html();
     var regExMatch = /premier(( {1,5}?)?co(mpany)?([ |\.])?)?/ig;
     var replaceWith = "Nikon";
     var resultSet = replacementDoneIn.replace(regExMatch, replaceWith);
     $("body").html(resultSet);
});
</code></pre>

<p>which is some what working for me, but it does not cover more robust and complicated scenario.</p>

<p>I would like to expand find/replace capabilities with a help of jQuery. To properly utilize find/replace of the text inside of the body element excluding any html elements and any attributes and their values. </p>

<p><strong>note</strong>: Not being completely certain on how jQuery text() function traverses children of the element it is applied on to.</p>

<p><strong>note</strong>: as far as i understand i can loop through all elements in html via <code>$("*")</code>, but does that create any issues for such script</p>

<p>so if you could direct me to the right path, it would be greatly appreciated. Links to resources that address this already, your advices, all will work. Because for some reason my head produces only complicated solutions, so I am wondering may be there are simpler approach.</p>

<p>Thank you in advance.</p>
