解决方案 »

  1.   

    url\(.*?\) 
    在线测试
      

  2.   

     String s="#nav_trail .nav_trail_l {";
     s+="font-size: 12px;";
     s+="color: #888;";
     s+="background: transparent url(../images/a.gif) no-repeat";
     s+="scroll right center;";
     s+="}";
     s+="background: url(http://test.2.cna/images/d.gif)";
     s+="background: url(\"\\imgs\\hn_more.gif\") no-repeat scroll 20px 0 transparent;";
     Matcher m = Pattern.compile("url\\(\"?(.*?)\"?\\)").matcher(s);
     while(m.find()){
     System.out.println(m.group(1));
     }
      

  3.   

    这个截取就包括url在里面  我想要的结果不包括url在里面比如结果为../images/li_bg12.gif