List of utility methods to do IP Address Validate
boolean | isIPAddress(String line) Checks if a string is a ip address Pattern p = Pattern.compile( "^(?:(?: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]?)$"); Matcher m = p.matcher(line); if (m.find()) { return true; return false; |
boolean | isIpAddress(String str) is Ip Address return isMatcher(str, IPADDRESS_PATTERN);
|
boolean | isIPAndPort(String text) is IP And Port if (isEmpty(text)) return false; String[] texts = text.split(":"); if (texts.length != 2) return false; Pattern pattern = Pattern.compile( "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2([0-4][0-9]|5[0-5]))\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2([0-4][0-9]|5[0-5]))$"); Matcher matcher = pattern.matcher(texts[0]); ... |
boolean | isIpFormat(String ip) ip address verification String regEx = "^((?:(?:25[0-5]|2[0-4]\\d|((1\\d{2})|([1-9]?\\d)))\\.){3}(?:25[0-5]|2[0-4]\\d|((1\\d{2})|([1-9]?\\d))))$"; Pattern pat = Pattern.compile(regEx); Matcher mat = pat.matcher(ip); return mat.find(); |
boolean | isIPSect(String ip) is IP Sect return Pattern.compile( "^((2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.){2}((2[0-4]\\d|25[0-5]|[01]?\\d\\d?|\\*)\\.)(2[0-4]\\d|25[0-5]|[01]?\\d\\d?|\\*)$") .matcher(ip).find(); |
boolean | isIPString(String str) is IP String if (IP_PATTERN.matcher(str).matches()) return true; else return false; |
boolean | isIpv4(String ipv4) is Ipv if (ipv4 == null) { return false; return REGX_IP.matcher(ipv4).matches(); |
boolean | isIpV4Address(CharSequence address) is Ip V Address if (address == null) { return false; return IPV4_PATTERN.matcher(address).matches(); |
boolean | isIPv4Address(final String input) is I Pv Address return IPV4_PATTERN.matcher(input).matches();
|
boolean | isIPv4Address(final String input) Is i pv 4 address boolean. return IPV4_PATTERN.matcher(input).matches();
|