哪位高手有截取url中 一级域名的 java代码
谁有截取url中 一级域名的 java代码
如题 坐等
------解决方案--------------------
如题 坐等
------解决方案--------------------
- Java code
String s = "topic.****.net/u/20120604/22/2479ec15-887a-4a7f-9ca6-042d37214302.html"; Pattern p = Pattern.compile("(?<=//|)((\\w)+\\.)+\\w+"); Matcher m = p.matcher(s); if(m.find()){ System.out.println(m.group()); }