81,095
社区成员
发帖
与我相关
我的任务
分享
String source = "<font style=\"color=#104531\" size=+1><b>开往:碧沙湖</b></font>";
Pattern pattern = Pattern.compile("<b>.*</b>");
Matcher matcher = pattern.matcher(source);
if(matcher.find()){
System.out.println(matcher.group().replace("<b>", "").replace("</b>", ""));
}
public static void main(String[] args) {
String a = "<font style=\"color=#104531\" size=+1><b>开往:碧沙湖</b></font>";
Pattern pt2 = Pattern.compile("(<font style=\"color=#104531\" size=\\+1>)(.*?)(</font>)");
Matcher mc2 = pt2.matcher(a);
if(mc2.find()){
System.out.println(mc2.group(2));
}
}