ITeye博客

正则替换

lvmlvy · 2014-06-10 14:17 · java · Web前端 · Markdown

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

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。