A função principal é: substitua o valor da tag IMG SRC na sequência HTML.
O código é o seguinte:
pacote com.junlenet.common.util; importar java.util.regex.matcher; importar java.util.regex.pattern;/*** html de ferramenta de processamento* @Author Huweijun* @date 13 de julho, 2016 às 7:25:09 pm*/Public Ht Ht Ht Ht Ht Hts. tag* @param str string a ser processada* @param tagTag Nome* @param tagattrib O valor do atributo de tag a ser substituído* @param startTag nova tag Tag tag* @param endTag Nova tag de tag* @return* @author huweijun* @ @13 de julho 2016 AT 7:15:32 Pm*/public huweijun* @13 de julho de 2016, 7:15:32 Pm*/public. startTag, string endTag) {string regXpfortag = "<// s*" + tag + "// s + ([^>]*) // s*"; string regXpfortaGattrib = tagAttrib + "= // s*/" ([^/"] +)/" "; padringFortForTert = padrão.Cattern.Cattern.CortInB) (regxpfortagattrib, padrony.case_insensitive); PatternForttrib.Matcher (Matcherfortag.Group (1)); Matcherfortag.appendReplaceme (sb, sbreplace.toString ()); class =/"imgbox/"> <li> <img id =/"160424/" src =/"uploads/allImg/160424/1-160424120t1-50.jpg/" class =/"src_class/"> </li> "); src =/"uploads/allImg/150628/1-15062q12247.jpg/" class =/"src_class/"> </li> </ul> "); system.out.println (" a string original é: "+content.toString ()); stringht = therentln (a string original é:"+content.toString ()); "src", "src =/" http://junlenet.com/ ""/"");O método acima de substituir o valor SRC na tag IG no script regular Java é todo o conteúdo que compartilhei com você. Espero que você possa lhe dar uma referência e espero que você possa apoiar mais o wulin.com.