title: Java regex - erase characters followed by \b (backspace)
body: <p>I have a string constructed from user keyboard types, so it might contain <code>'\b'</code> characters (backspaces).</p>
  
  <p>I want to clean the string, so that it will not contain the <code>'\b'</code> characters, as well as the characters they are meant to erase. For instance, the string:</p>
  
  <pre><code>String str = "\bHellow\b world!!!\b\b\b.";
  </code></pre>
  
  <p>Should be printed as:</p>
  
  <pre><code>Hello world.
  </code></pre>
  
  <p>I have tried a few things with replaceAll, and what I have now is:</p>
  
  <pre><code>System.out.println(str.replaceAll("^\b+|.\b+", ""));
  </code></pre>
  
  <p>Which prints:</p>
  
  <blockquote>
    <p>Hello world!!.</p>
  </blockquote>
  
  <p>Single <code>'\b'</code> is handled fine, but multiples of it are ignored.  </p>
  
  <p>So, can I solve it with Java's regex?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I have seen <a href="https://stackoverflow.com/a/16604714/1609201">this</a> answer, but it seem to not apply for java's replaceAll.<br>
  Maybe I'm missing something with the verbatim string...</p>