Case insensitive replace all
<p>I am looking for any implementation of case insensitive replacing function. For example, it should work like this:</p>

<pre><code>'This iS IIS'.replaceAll('is', 'as');
</code></pre>

<p>and result should be:</p>

<pre><code>'Thas as Ias'
</code></pre>

<p>Any ideas?<br>
Thanks in advance.</p>

<p><strong>UPDATE:</strong><br>
It would be great to use it with variable:</p>

<pre><code>var searchStr = 'is';
'This iS IIS'.replaceAll(searchStr, 'as');
</code></pre>
