I’m tring to extract the font face name e.g.:
String htmlContent = "<font face=\"impact\">Hdjdjdisid <font style=\"background-color:#ff0000\"> shejej</font></font>";
to:
impact
This is what I found on the web but it’s returning all the tags’ content and i want only the face
name.
String pattern = "<FONT (.*?)>";
Pattern p = Pattern.compile(pattern, Pattern.CASE_INSENSITIVE);
Matcher m = p.matcher(htmlContent);
if (m.find()) {
// prints: <FONT FACE="Verdana" SIZE="12"> My Name is xyz </FONT></P>
System.out.println(m.group());
// prints: FACE="Verdana" SIZE="12"
System.out.println(m.group(1));
}
How can I extract only the face name?