Javascript: s/digit/" " x that digit/g
<p>I would like to match a digit and replace it with that many spaces. Can this be done in less than 9 lines of code?</p>

<p>Example</p>

<pre><code>"asnthsnth4nts4h3n" --&gt; "asnthsnth    nts    h   n"
</code></pre>
