in reply to Unbalanced Tags

This sounds like the perfect job for a stack or LIFO. A similar exercise is parenthesis matching. Push tags that you find onto the stack. If you encounter a closing tag, pop the stack and compare what you popped to the current closing tag. Mismatched tags are bad HTML but rarely harmful. If, at the end, you have leftover tags, you have unclosed tags. Beware! Old standards allow this in a limited form, most notably for <p> tags among others. You'd need to read up on the standards to see which are acceptable and which are not.
AgentM Systems nor Nasca Enterprises nor Bone::Easy nor Macperl is responsible for the comments made by AgentM. Remember, you can build any logical system with NOR.

Replies are listed 'Best First'.
Re: Re: Unbalanced Tags
by lzcd (Pilgrim) on Jan 19, 2001 at 07:48 UTC
    I was thinking about doing that also but my brain didn't get around to it until after the post.

    Doh.

    Oh for the lack of a brain, the code was lost...