Searchbox is unspecific
<p>hey, i try to write a code that users give the possibility to search words in a textarea. my problem is that the regex does not work. </p>

<p>as example:
if i have "hello stackoverflow" in the textarea and the user search "hello" he recieve on 1 hit and this is correct, but if he search "hello lorem ipsum" he also recieve 1 hit.</p>

<pre><code>    regex = new RegExp($("input.search").val(), 'g');
    counter = $("textarea").val().match(regex).length;
</code></pre>

<p>what is wrong with the code?</p>
