java regex ip

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

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}