Javaの正規表現を使って文字列を置き換える方法

Javaコード:

String str = “<p><img src=’http://172.16.XXX.XXX/pic/startnews24img1.jpg’><img src=’http://localhost/pic/startnews24img2.jpg’><img src=’/pic/startnews24img3.jpg’></p>";

String subStr = str.replaceAll(“src=(.+?)/Picture", “src=\"http://XXX/pic");

System.out.println(subStr);

Java

Posted by arkgame