Is there any reason why you want to use regular expressions? There are far more competent, easier to work with, robust tools available for working with HTML documents are you are.
If you haven’t already, and aren’t restricted to using regex, have a look at the DOM. If that sounds like a good idea, or you want to stick with regex, let us know.