title: Java regex to find whitespaces or upper-case characters
body: <p>I have a method that validates a string and makes sure it doesn't have any whitespaces or upper-case characters:</p>
  
  <pre><code>boolean validate(String input) {
      if(input.matches(".*\\S.*([A-Z]+)")) {
          return false;
      }
  
      return true;
  }
  </code></pre>
  
  <p>Unfortunately, when I run this, it simply doesn't work. It doesn't throw any exceptions, it just allows all input string ("HelloWorld", "hello world", "Hello world", etc.) to pass validation. Any ideas where I'm going wrong?</p>