Get substring after first space and before first instance of a special character?
<p>I am successfully returning a substring before the first instance of a space in a string:</p>

<pre><code>var str = "test1 test2 test3 (test4)";
var str_BeforeSpace = str.substr(0,str.indexOf(' '));
// returns "test1"
</code></pre>

<p>What I'm trying to do next is return a substring that exists after the first space and before the first instance of a "(". In this example, the desired substring is "test2 test3" (with no trailing spaces) ...</p>