You only match 1 chunk of 0+ letters and 0+ whitespaces.
You need to use matcher.find() in a while loop and use a regex like [a-z]+ or \b[a-z]+\b:
String test = "john smith 11 12323 2323";
Pattern pattern = Pattern.compile("[a-z]+");
Matcher matcher = pattern.matcher(test);
while (matcher.find()) {
System.out.println(matcher.group());
}
// => john, smith
See the Java demo.
If you need to match "words" before whitespace/end of string, use "\\b[a-z]+(?!\\S)" regex.
To match john smith you may use "^[a-z]+(?:\\s+[a-z]+)*" regex (and then you may replace while with if since you only expect 1 match).
String test = "john smith 11 12323 2323";
Pattern pattern = Pattern.compile("^[a-z]+(?:\\s+[a-z]+)*");
Matcher matcher = pattern.matcher(test);
if (matcher.find()) {
System.out.println(matcher.group());
} // => john smith
See this Java demo.
String.split(" ")