日期:2014-05-20 浏览次数:20779 次
public static void main(String[]args) { String url ="http://192.168.1.2:7001/Forum"; java.util.regex.Matcher m = java.util.regex.Pattern.compile("(\\d{0,3}\\.){3}\\d {0,3}").matcher(url); if(m.find())System.out.println(m.group()); }