Java IP Address Check checkIpAddress(String ipAddress)

Here you can find the source of checkIpAddress(String ipAddress)

Description

check Ip Address

License

Open Source License

Declaration

public static void checkIpAddress(String ipAddress) 

Method Source Code

//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
    }
}

Related

  1. checkIP(String requestIP, String[] ips)