Here you can find the source of isIPv4Address(String ipAddress)
public static boolean isIPv4Address(String ipAddress)
//package com.java2s; //License from project: Apache License import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { private static Pattern VALID_IPV4_PATTERN = null; public static boolean isIPv4Address(String ipAddress) { Matcher m1 = VALID_IPV4_PATTERN.matcher(ipAddress); return m1.matches(); }/*from ww w.jav a 2s. c o m*/ }