I am trying to extract the text from the below html snippet. Need help in regex pattern that will replace all the html tag and only will leave out the content.
I tried to remove the <span*> using the below expression but that didn't do the trick.
String x = '<span style="font-size:11pt;"><span style="line-height:107%;"><span style="font-family:Calibri, sans-serif;"><strong><font color="#000000">Some normal text here...</font></strong></span></span></span>';
String y = x.replaceAll('[<span*\b>]','');
system.debug(y);
This prints out:
tyle="fot-ize:11t;" tyle="lie-height:107%;" tyle="fot-fmily:Clibri, -erif;"trogfot color="#000000"Some normal text here.../fot/trog///
So it basically replaced the each character individually and not the content between the <span ... >
Need Help
.replaceAll("<span.*?>","")