Refining the JavaScript indexOf statement
<p>I'm writing a simple search algorithm in JavaScript.</p>

<pre><code>var title = "The Greatest Movie Ever Made is here!";
var search1 = "the greATEST movie";
var search2 = "here IS made"
var search3 = "ever movie greatest the"
</code></pre>

<p>Using <strong>indexOf()</strong> only returns search1 false but search2,3 are true as well. How would I write a simple search algorithm to recognise instances where the words may not be in the right order or clumped together?</p>
