You might want to check out one of the template modules on CPAN.
eg: HTML::Template
or: Text::Template a review of this is available here
or: Template::Toolkit
You might also look at the parsing module HTML-Parser if this suits you needs better.
Those might help you more than a single regex.
All these modules have been discussed on Perlmonks, so doing a Super Search should give you lots more of information.