Here you can find the source of isIPAddress(String ipAddress)
public static boolean isIPAddress(String ipAddress)
//package com.java2s; //License from project: Open Source License import java.util.regex.Pattern; public class Main { public static boolean isIPAddress(String ipAddress) { return Pattern.matches( "^[1-9](\\d{1,2})?\\.(0|([1-9](\\d{1,2})?))\\.(0|([1-9](\\d{1,2})?))\\.(0|([1-9](\\d{1,2})?))$", ipAddress);/*from ww w .ja v a 2 s . c om*/ } }