title: Regex for name String matching. (JAVA)
body: <p>I am wanting to write a regular expression that will match any String that contains the name. Though it has some restrictions when matching with a String.</p>
  
  <p><strong>Rule: The first letter of each String is the only letter that can be capital.</strong></p>
  
  <p>Valid names are:
  Samuel,
  Samuel Fosters,
  Samuel Johnson Fosters</p>
  
  <p>Invalid names are:
  samuel,
  samuel Fosters,
  Samuel fosters,
  SamuelFosters</p>
  
  <p>This is the regex that I have written so far:</p>
  
  <pre><code>"[A-Z][a-z]|[A-Z][a-z]+(\\s[A-Z][a-z]+)+"
  </code></pre>
  
  <p>I am getting true for all the valid names, but it is also returning true for the invalid cases.</p>
  
  <p>How would I edit the regex so that it returns false for the invalid names while returning true for the valid names?</p>