Your regex matches any string of length 3 starting and ending with [a-z0-9] because you're not escaping the '.' which stands for any character. Moreover, the set of character in parenthesis should be repeated. For example you could use something like:
[\d]*\.[\d]*\.[\d]*\.[\d]*
which matches one or more digits followed by a period three times and finally one or more digits. This means you'll get a match for any string of the form '123.456.789.101' but also stuff like '122533252.13242351432142.375547547.62463636', so that's not completely helpful.
An improvement, but not perfect, is the following:
[\d][\d][\d]\.[\d][\d][\d]\.[\d][\d][\d]\.[\d][\d][\d]
which will match groups of three digits separated by a dot.
If you want to fast forward to something much more interesting and effective but also more difficult to understand if you are a beginner, you can use the example found on this page, that is:
\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b
which does exactly what you need.
Moreover, the matches() method tries to match all of the input, not a section of it, so you could add a '.*' at the beginning and end of the regex and run it from java code like this:
Pattern p = Pattern.compile(".*\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b.*");
Matcher matcher = p.matcher(message);
if (matcher.matches()) System.out.println("It's a match");
If you want to find all the IPs you can do instead:
Pattern p = Pattern.compile("\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b");
Matcher matcher = p.matcher(message);
while (matcher.find()) System.out.println("Match: " + matcher.group());
Regexes are wonderful although the learning curve is steep. So good luck learning!