Removing parentheses in an input field, the text between them and the space before them?
<p>In this <a href="http://stackoverflow.com/questions/9597463/finding-opening-and-closing-parentheses-in-an-input-field-delete-them-together/9597893#9597893">previous question</a>, I asked how to remove parenteshes and the text inside them. Got this:</p>

<pre><code>$(this).val($(this).val().replace(/\(.+\)/, ''));
</code></pre>

<p>So this: <code>food (454)</code> becomes this: <code>food</code></p>

<p>This works fine but now I would like to not only remove the parentheses and the text between them but also to remove the space before the parentheses.</p>

<p>In the example above, the space I'm talking about would be the space between the letter <code>d</code> and the <code>(</code></p>

<p>How to modify the code so that it can accomplish that?</p>
