in reply to Re: Re: Re: regex problem...
in thread regex problem... parsing html font tags

What you'd probably want to do is setup handlers for end tags and text, and have all handlers append to a string the text you want them replaced with or the original the text if you don't want them replaced.

For handling ending FONT tags, you can catch the end of tag event and insert the appropriate ending tag. If the ending tag may vary you can keep (an) array(s) indicating what type of ending tag(s) to use (each element telling you information for one tag), push onto them when you encounter a start FONT tag, and pop off them when you encoutner an end FONT tag and output the appropriate tags.

(update: last paragraph rewritten)