日期:2014-05-20 浏览次数:20665 次
String p = "(\\d)|([1-9]\\d)|(1\\d\\d)|(2[0-4]\\d)|(25[0-5])"; String ip = "(("+p+")\\.){3}("+p+")"; String s = "192.0.256.3"; System.out.println(s.matches(p));