title: pattern.matcher() vs pattern.matches()
body: <p>I am wondering why the results of the java regex pattern.matcher() and pattern.matches() differ when provided the same regular expression and same string   </p>
  
  <pre><code>String str = "hello+";
  Pattern pattern = Pattern.compile("\\+");
  Matcher matcher = pattern.matcher(str);
  
  while (matcher.find()) {
      System.out.println("I found the text " + matcher.group() + " starting at " 
          + "index " + matcher.start() + " and ending at index " + matcher.end());
  }
  
  System.out.println(java.util.regex.Pattern.matches("\\+", str));
  </code></pre>
  
  <p>The result of the above are:</p>
  
  <pre><code>I found the text + starting at index 5 and ending at index 6
  false
  </code></pre>
  
  <p>I found that using an expression to match the full string works fine in case of <code>matches(".*\\+")</code>.</p>