import java.util.regex.*; public class Test{ public static void main(String[] args){ String str="<p style=\"font-size:1.3em;font-weight:bold\">No page with that title exists.</p> "; String regex="<p.*?>(.*?)</p> "; Pattern p =Pattern.compile(regex); Matcher m=p.matcher(str); while(m.find()){ System.out.println(m.group(1)); } } }本回答被提问者采纳