ariel2 has asked for the wisdom of the Perl Monks concerning the following question:

Venerable Monks, I need to search a chunk of html and match any div tags that only contain other html tags or space in them. Any div tags that actually have text in them should be left alone. Anyone know how to do this? Thanks, Ariel

Replies are listed 'Best First'.
Re: regex question
by moritz (Cardinal) on Jun 23, 2010 at 14:02 UTC
    Trying to find a robust regex solution for your problem will likely lead to insanity. On the other hand using a module such as HTML::TreeBuilder should make this fairly simple.
      Thanks for the speedy reply! I haven't played with HTML::TreeBuilder yet. I'll check it out.

      Ariel