public class Homework {

public static void main (String[]args){

String a  = "<div><h3>hello</h3></div><p><div>ok</div></p><div>hello333</div>";

Pattern s = Pattern.compile("<div>.*?</div>");

Matcher n = s.matcher(a);

while(n.find()){

 

System.out.println(n.group().replaceAll(".*<div>|</div>.*",""));

}

}

}

posted on 2020-09-27 15:32  liuyunche  阅读(304)  评论(0编辑  收藏  举报