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
pattern.matcher(String s) returns a Matcher that can find patterns in the String s. pattern.matches(String str) tests, if the entire String (str) matches the pattern.
In brief (just to remember the difference):
pattern.matcher - test if the string contains-a patternpattern.matches - test if the string is-a pattern