title: PHP Regex for human names
body: <p>I've run into a bit of a problem with a Regex I'm using for humans names.</p>
  
  <pre><code>$rexName = '/^[a-z' -]$/i';
  </code></pre>
  
  <p>Suppose a user with the name Jürgen wishes to register? Or Böb? That's pretty commonplace in Europe. Is there a special notation for this?</p>
  
  <p>EDIT:, just threw the Jürgen name against a regex creator, and it splits the word up at the ü letter...</p>
  
  <p><a href="http://www.txt2re.com/index.php3?s=J%FCrgen+Blalock&amp;submit=Show+Matches" rel="noreferrer">http://www.txt2re.com/index.php3?s=J%FCrgen+Blalock&amp;submit=Show+Matches</a></p>
  
  <p>EDIT2: Allright, since checking for such specific things is hard, why not use a regex that simply checks for illegal characters?</p>
  
  <pre><code>$rexSafety = "/^[^&lt;,\"@/{}()*$%?=&gt;:|;#]*$/i";
  </code></pre>
  
  <p>(now which ones of these can actually be used in any hacking attempt?)</p>
  
  <p>For instance. This allows ' and - signs, yet you need a ; to make it work in SQL, and those will be stopped.Any other characters that are commonly used for HTML injection of SQL attacks that I'm missing?</p>