title: How to remove spaces & brackets from a phone number with Regex?
body: <p>How can I remove spaces and brackets from a phone number according to the following example with Regular Expressions?</p>
  
  <p>Input: <code>+7(999) 999 99 99</code>
  Output: <code>+79999999999</code></p>
  
  <p>I tried the following code, but it didn't work for me:</p>
  
  <pre class="lang-js prettyprint-override"><code>const phone = "+7(999) 999 99 99";
  phone.replace(/\s/g, "");
  </code></pre>