正则替换

String str = "<p><img src='http://172.16.132.234/Picture/1.jpg'><img src='http://localhost/Picture/2.jpg'><img src='/Picture/3.jpg'></p>";

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

        System.out.println(subStr);

 

 

http://www.cnblogs.com/android-html5/archive/2012/06/02/2533924.html

你可能感兴趣的:(正则)