title: Regular Expression Check for Capital Names in PostgreSQL
body: <p>I have a database, which holds many first names, occurring like the following pattern:</p>
  <p>The name can consist of many first names (like double, or triple names), separated by either a '-' or a ' '.
  Each of the names consists of either lowercase or UPPERCASE letters or a capital first letter and the rest lowercase.</p>
  <p>I would like to write a query to count all names which have either just UPPERCASE letters, or do not have a capital letter after a break of two words.</p>
  <h3>Sample <em>Table</em> and <em>Data</em></h3>
  <pre><code>CREATE TABLE names( name VARCHAR, PRIMARY KEY(name) ); 
  INSERT INTO names values('Veronika isabella'); 
  INSERT INTO names values('Veronika Isabella'); 
  INSERT INTO names values('Michael Karl Otto- Emil'); 
  INSERT INTO names values('Michael karl-Otto-emil'); 
  INSERT INTO names values('philipp'); 
  INSERT INTO names values('Philipp');
  </code></pre>