public static boolean validateVersion(String version){
  return version.matches("\\d+\\.\\d+(\\.\\d+)?");
}

public static boolean validateVersion ( String version ) { return version . matches ( "\\d+\\.\\d+(\\.\\d+)?" ) ; }
validate that the version conforms to the format xx . yy . zz or xx . yy
