字符串截取替换有关问题

字符串截取替换问题String str 。。。fffffff现权力的监督与制约img src\http://www.47re.jpg\ width

字符串截取替换问题
String str = "。。。fffffff现权力的监督与制约<img src=\"http://www.47re.jpg\" width=\"320\" height=\"140\"/>与执行,现权力的监督与制约--------<img src=\"http://www.4xx.jpg\" width=\"320\" height=\"140\"/>与执行,执行执行"。。。。。;

想实现把所有<img标签中的 height=\"140\" 改为 height=\"266\"
说明:这些代码中只替换<img标签中的height的值。。


给段能运行的代码,谢谢!



[解决办法]
str.replaceAll("height=\"140\"", "height=\"266\"")
[解决办法]

Java code
public static void main(String[] args) throws Exception {        String str = "。。。fffffff现权力的监督与制约<img src=\"http://www.47re.jpg\" width=\"320\" height=\"140\"/>与执行,现权力的监督与制约--------<img src=\"http://www.4xx.jpg\" width=\"320\" height=\"140\"/>与执行,执行执行";        str = str.replaceAll("(?is)<img(.*?)height=\"140\"","<img$1height=\"266\"");        System.out.println(str);    }
[解决办法]
Java code
    String str = "\"。。。fffffff现权力的监督与制约<img src=\\\"http://www.47re.jpg\\\" width=\\\"320\\\" height=\\\"140\\\"/>与执行,现权力的监督与制约--------<img src=\\\"http://www.4xx.jpg\\\" width=\\\"320\\\" height=\\\"140\\\"/>与执行,执行执行\"。。。。。;";        String newstr=null;        newstr=str.replace("height=\\\"140\\\"","height=\\\"266\\\"");        System.out.println(newstr);