title: Javascript regex to replace numbers in sequence
body: <p>I am trying to replace numbers in string with the character "X" which works pretty good by replacing every individual number. </p>
  
  <p>This the code:</p>
  
  <pre><code> let htmlStr = initialString.replace(/[0-9]/g, "X");
  </code></pre>
  
  <p>So in a case scenario that <code>initialString = "p3d8"</code> the output would be <strong>"pXdX"</strong></p>
  
  <p>The aim is to replace a sequence of numbers with a single "X" and not every number (in the sequence) individually. For example:</p>
  
  <p>If <code>initialString = "p348"</code> , with the above code, the output would be "pXXX". How can I make it "pX" - set an "X" for the whole numbers sequence.</p>
  
  <p>Is that doable through regex?</p>
  
  <p>Any help would be welcome</p>