java regex ip

Solutions on MaxInterview for java regex ip by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "java regex ip"
Leon
06 Feb 2019
1String pattern = "([01]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])";
Doris
02 Sep 2020
1public static boolean isIP(String ip)  {
2    Pattern p = Pattern.compile("(([01]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])\\.){3}([01]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])");
3    Matcher m = p.matcher(ip);
4    return m.matches();
5}