Java tutorial
//package com.java2s; public class Main { public static boolean isIPAddr(String input) { return (input != null && input.matches("\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}")); } }