这是我的代码,请检查。最后我想删除 list-style-image: url(images/dot.gif); 从字符串
String temp = "font-family: Arial, Helvetica, sans-serif;font-size: 11px;color: F143F;list-style-image: url(images/dot.gif);list-style-type: none;";
Pattern pxPattern = Pattern.compile("([a-z]+-)+([a-z]+):(\\s)url\\(.*?\\);");
Matcher pxMatcher = pxPattern.matcher(temp);
while(pxMatcher.find()) {
System.out.println(pxMatcher.group());
String urlString =pxMatcher.group();
if(!urlString.matches("http://|https://")) {
System.out.println("Firts: "+temp.trim());
System.out.println(urlString);
System.out.println(temp.replaceAll(urlString, ""));
//System.out.println("Remove: "+temp);
}
}