title: Regex to replace part of the string with spaces
body: <p>It seems simple, but I can't get it work. </p>
  
  <p>I have a string which look like 'NNDDDDDAAAA', where 'N' is non digit, 'D' is digit, and 'A' is anything. I need to replace each A with a space character. Number of 'N's, 'D's, and 'A's in an input string is always different.</p>
  
  <p>I know how to do it with two expressions. I can split a string in to two, and then replace everything in second group with spaces. Like this</p>
  
  <pre><code>    Pattern pattern = Pattern.compile("(\\D+\\d+)(.+)");
      Matcher matcher = pattern.matcher(input);
      if (matcher.matches()) {
          return matcher.group(1) + matcher.group(2).replaceAll(".", " ");
      }
  </code></pre>
  
  <p>But I was wondering if it is possible with a single regex expression.</p>