title: Replacing elements in a QString based on a predicate
body: <p>I need to replace characters in a <code>QString</code> based on their
  <code>QChar::category</code>. In stdlib terms I want to</p>
  
  <pre><code>string.erase(std::remove_if(begin(string), end(string), 
                              [](QChar c) { 
                              QChar::Category cat = c.category(); 
                              return cat == .... || cat == ...; }), 
               string.end());
  </code></pre>
  
  <p>Alternatively, I'm happy with a regexp that works on unicode character
  categories that I can use for <code>QString::replace</code>.</p>
  
  <p>Is that possible with QString or do I really need to turn the string
  in a <code>std::vector&lt;QChar&gt;</code> and back?</p>
  
  <p>Edit: The categories I want to <em>keep</em>:</p>
  
  <ul>
  <li>for the first charater: $, _, or any character in the Unicode categories “Uppercase letter (Lu)”, “Lowercase letter (Ll)”, “Titlecase letter (Lt)”, “Modifier letter (Lm)”, “Other letter (Lo)”, or “Letter number (Nl)”</li>
  <li>for the rest: the first bullet plus any U+200C zero width non-joiner characters, U+200D zero width joiner characters, and characters in the Unicode categories “Non-spacing mark (Mn)”, “Spacing combining mark (Mc)”, “Decimal digit number (Nd)”, or “Connector punctuation (Pc)”.</li>
  </ul>
  
  <p>I can do first/rest in multiple passes.</p>