Take the 2-minute tour ×  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}  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?  share|improve this question Are
you wanting the code to physically be deleted or just the divs
just hidden? –  anjunatl Jan 27 '12 at 15:23 It is much better
to do with using DOMDocument and XPath,