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
The code equivalent to java.util.regex.Pattern.matches("\\+", str) would be:
java.util.regex.Pattern.matches("\\+", str)
Pattern.compile("\\+").matcher(str).matches();
method find will find the first occurrence of the pattern in the string.
find