Add a prefix of +1 to a string : <p>How can I remove all non 10 digit numbers from a string, and add a +1 to the front of it if it doesn't exist yet?</p>

<p>Here's the regex code I have:</p>

<pre><code>phoneNumber.replace(/[^0-9.\,]/g, '');
phoneNumber = '+1' + phoneNumber;
</code></pre>

<p>but this won't work if <code>phoneNumber</code> already has <code>+1</code>. How can I make it that the regex first removes all non numerical, and adds a prefix of +1?</p>
