You can use a regex for it.
The regex "[\\d]+\\.[\\d]+\\.[\\d]+"
should work.
\\d
- means a digit.- the '+' means one or more of the last element.
\\.
is a dot.
Code snap:
Matcher matcher = Pattern.compile("[\\d]+\\.[\\d]+\\.[\\d]+").matcher("");
matcher.reset("11.1234.33333");
System.out.println(matcher.matches());
matcher.reset("1.abcd.3");
System.out.println(matcher.matches());
Will produce, as expected:
true
false