 <p>if you have exact the format <code>+Z (YYY) XXX-XX-XX</code>:</p> <pre><code>var num = input.replace( '/^\+\S+\s\((\d{3})\)\s(\d{3})-(\d{2})-(\d{2})$/', '\1\2\3\4' ); </code></pre> <p>but a more tolerant variant would be</p> <pre><code>var num = input.replace( '/^(\+\S+|\D/', '' ); </code></pre>