Java IP Address Validate isIPAddress(String ipAddress)

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

Description

is IP Address

License

Open Source License

Declaration

public static boolean isIPAddress(String ipAddress) 

Method Source Code


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

Related

  1. isIpAddress(String addr)
  2. isIpAddress(String ip)
  3. isIPAddress(String ipAddress)
  4. isIpAddress(String ipAddress)
  5. isIpAddress(String ipAddress)
  6. isIPAddress(String line)
  7. isIpAddress(String str)
  8. isIPAndPort(String text)
  9. isIpFormat(String ip)