正则表达式

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 }
View Code

 

posted @ 2017-05-20 23:16  danawill  阅读(112)  评论(0编辑  收藏  举报