var somestring = "mary(3) apple(2) sky(1)";
$("#removelaststring").unbind("click").bind("click",function(e){
somestring = somestring.replace(/\(\d+\)*$/, "")
alert(somestring);
});
i should get
mary(3) apple(2) sky
then if i run it agan
mary(3) apple sky
if run again
mary apple sky
however this doesn't happen, no matter how many times i click i get
mary(3) apple(2) sky