I have a string which contain a DIV tag to remove.
I can recognize the DIV to remove by its parameters (the specific style in this case) that is unique. This DIV contains a lot of HTML inside including other DIVs.
<div style="padding-top: 10px; clear: both; width: 100%;">
{ a lot other divs here}
</div>
How remove it from the string?
EDIT: (Any useful technique is welcome)
EDIT 2: I know about the inconvenience of using ergualr expressions. If you have a solution using regexs
is welcome too because is a one-stop parsing process ans the text is very small and the HTML is well-construted (Indeed is XHTML).
EDIT 3: If possible please show an example using a HTML/DOM parser or Xpath
or whatever. The problem here is not select data else remove data. Can be done with HTML/DOM parser or Xpath
?