WebページのHTMLを読んでから、リンクと画像を見つけて、リンクと画像の名前を変更する必要があります。
reader = new BufferedReader(new InputStreamReader(socket.getInputStream(), 'UTF-8'));  
String line;  
while ((line = reader.readLine()) != null) { 
    regex = "<a[^>]*href=(\"([^\"]*)\"|\'([^\']*)\'|([^\\s>]*))[^>]*>(.*?)</a>";  
    final Pattern pa = Pattern.compile(regex, Pattern.DOTALL);  
    final Matcher ma = pa.matcher(s);  
    if(ma.find()){  
        string newlink=path+"1-2.html";
        //replace the link in href with newlink, how can i do this?
    }  
    html.append(line).append("/r/n");  
}  
コメント部分はどうすればいいですか