正则表达式
1 public class Test { 2 public static void main(String[] args) { 3 String str ="http://detail.zol.com.cn/cell_phone_advSearch/subcatedaddal1-s_1.html?#show"; 4 Pattern pattern =Pattern.compile("http://detail.zol.com.cn/cell_phone_advSearch/subcate[\\w\n]"); 5 Matcher matcher = pattern.matcher(str); 6 System.out.println(matcher.find()); 7 } 8 }