public static boolean isIP(String input){
  String regex="(?:[0-9]{1,3}\\.){3}[0-9]{1,3}";
  Pattern p=Pattern.compile(regex);
  Matcher m=p.matcher(input);
  String ss=input.replace(".","");
  if (m.find() && isNumeric(ss) && (input.length() - ss.length() > 2)) {
    return true;
  }
  return false;
}

public static boolean isIP ( String input ) { String regex = "(?:[0-9]{1,3}\\.){3}[0-9]{1,3}" ; Pattern p = Pattern . compile ( regex ) ; Matcher m = p . matcher ( input ) ; String ss = input . replace ( "." , "" ) ; if ( m . find ( ) && isNumeric ( ss ) && ( input . length ( ) - ss . length ( ) > 2 ) ) { return true ; } return false ; }
checks if a given string is an ip address .
