title: PHP trim non-letters Unicode
body: <p>I need to trim a string of all characters <em>except</em> letters from any languages in UTF-8. For an early test this was working fine until obviously I started using UTF-8 non-Latin letters:</p>
  <pre><code>&lt;?php
  $s = '\$5ı龢abc';
  echo '&lt;p&gt;'.$s.'&lt;/p&gt;';
  while (!preg_match('/([\p{L}]+)/u', $s[0]))
  {
   $s = substr($s, 1);
   echo '&lt;p&gt;'.$s.'&lt;/p&gt;';
  }
  ?&gt;
  </code></pre>
  <p>This currently outputs the following:</p>
  <blockquote>
  <p>$5ı龢abc</p>
  <p>$5ı龢abc</p>
  <p>5ı龢abc</p>
  <p>ı龢abc</p>
  <p>�龢abc</p>
  <p>龢abc</p>
  <p>��abc</p>
  <p>�abc</p>
  <p>abc</p>
  </blockquote>
  <p>I would like the final output to be: <code>ı龢abc</code>. I'm not quite sure what I'm missing however?</p>