in reply to delete and substitute

Your sample data doesn't seem to be valid XML, so XML modules will fail.

Try the following line as a replace for both of yours:

s/<(\w+)>\s*<\/\1>//g;

Beware that this won't remove two "adjacent" tags from different lines, because you are processing one line at a time.

Replies are listed 'Best First'.
Re^2: delete and substitute
by Anonymous Monk on Dec 12, 2009 at 03:00 UTC
    This person keeps switching from HTML to XML, all trying to edit with regex, every time question changes by little bit