Here you can find the source of checkIpAddress(String ipAddress)
public static void checkIpAddress(String ipAddress)
//package com.java2s; //License from project: Open Source License public class Main { public static void checkIpAddress(String ipAddress) { if (!ipAddress.matches( "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$")) { throw new IllegalArgumentException("Mac Address must be in the form 255.255.255.255"); }//from www . ja v a2 s.c om } }