title: Replace digits in String with that amount of a certain character using regex one-liner
body: <p>Is it possible to replace digits in a String with that amount of a certain character like <code>'X'</code> using a regex? (I.e. replace <code>"test3something8"</code> with <code>"testXXXsomethingXXXXXXXX"</code>)?</p>
  
  <p>I know I could use a for-loop, but I'm looking for an as short-as-possible (regex) one-liner solution (regarding a code-golf challenge - and yes, I am aware of the codegolf-SE, but this is a general Java question instead of a codegolf question).</p>
  
  <ul>
  <li>I know how to replace digits with one character:<br>
  <code>String str = "test3something8".replaceAll("[1-9]", "X");</code> -> <code>str = "testXsomethingX"</code></li>
  <li>I know how to use groups, in case you want to use the match, or add something after every match instead of replacing it:<br>
  <code>String str = "test3something8".replaceAll("([1-9])", "$1X");</code> -> <code>str = "test3Xsomething8X"</code></li>
  <li>I know how to create <code>n</code> amount of a certain character:<br>
  <code>int n = 5; String str = new String(new char[n]).replace('\0', 'X');</code> -> <code>str = "XXXXX"</code></li>
  <li>Or like this:<br>
  <code>int n = 5; String str = String.format("%1$"+n+"s", "").replace(' ', 'X');</code> -> <code>str = "XXXXX"</code>;</li>
  </ul>
  
  <p>What I want is something like this (the code below obviously doesn't work, but it should give an idea of what I somehow want to achieve - preferably even a lot shorter):</p>
  
  <pre><code>String str = "test3Xsomething8X"
    .replaceAll("([1-9])", new String(new char[new Integer("$1")]).replace('\0', 'X')));
  // Result I want it to have: str = "testXXXsomethingXXXXXXXX"
  </code></pre>
  
  <p>As I said, this above doesn't work because "$1" should be used directly, so now it's giving a</p>
  
  <blockquote>
    <p>java.lang.NumberFormatException: For input string: "$1"</p>
  </blockquote>
  
  <hr>
  
  <p><strong>TL;DR:</strong> Does anyone know a one-liner to replace a digit in a String with that amount of a certain character?</p>