You should be able to do these kind of work easily with a module which parses HTML, such as HTML::TagReader. Here's a link to some examples on using it (the author of the article does some changes to font tags).
Michele.
Comment on Re: Reg Ex Problem: Changing width dimension in HTML table