in reply to case preservation in regexp

I don't want to jump to conclusions, but just in case, I'd like to mention that parsing HTML with regular expressions is usually a bad idea. There are many common pitfalls, and in the presence of some good CPAN modules, there's no reason to do it.

So even though your examples don't actually show HTML being parsed, it might be worthwhile to look at HTML::Parser, HTML::TokeParser, HTML::TokeParser::Simple, and perhaps HTML::TreeBuilder. Those are good general purpose modules. There are also some good specific purpose modules, such as HTML::TableExtract, that could be useful. Take some time searching CPAN, or asking around, and you may find something that makes your task a lot easier.