How can i parse HTML tags? For example:
How can I get the xxx from the above HTML tags?Code:<H1>xxx</H2>
<font size=3>xxxx</font>
Printable View
How can i parse HTML tags? For example:
How can I get the xxx from the above HTML tags?Code:<H1>xxx</H2>
<font size=3>xxxx</font>
You can use following code segment:
But if you need more advanced functionality, you can consider using a HTML parsing library instead:Code:String[] html = {"<H1>xxx</H2>","<font size=3>xxxx</font>"};
System.out.println(html[0].replaceAll("\\<.*?\\>",""));
System.out.println(html[1].replaceAll("\\<.*?\\>",""));
HTML Parser - HTML Parser
Jericho HTML Parser