why isn't this removing (digit) each time it's run?
<pre><code>var somestring = "mary(3) apple(2) sky(1)";
$("#removelaststring").unbind("click").bind("click",function(e){

somestring = somestring.replace(/\(\d+\)*$/, "")
alert(somestring);

});
</code></pre>

<p>i should get </p>

<pre><code>mary(3) apple(2) sky
</code></pre>

<p>then if i run it agan</p>

<pre><code>mary(3) apple sky
</code></pre>

<p>if run again</p>

<pre><code>mary apple sky
</code></pre>

<p>however this doesn't happen, no matter how many times i click i get</p>

<pre><code>mary(3) apple(2) sky
</code></pre>
