String str = "http://image.baidu.com/search/detail/cc.jpg5555http://image.baidu.com/search/detail/5033.jpeg";
String regex = "http://image.baidu.com/search/detail/(?!(\\.jpg|\\.jpeg|\\.png)).+?(\\.jpg|\\.jpeg|\\.png)";
Pattern p = Pattern.compile(regex);
Matcher ma = p.matcher(str);
while(ma.find()) {
System.out.println(ma.group());
}
JAVA正则表达式获取字符串里的http网址
最新推荐文章于 2023-06-01 08:37:44 发布