Try something like... this?
Code:
<([A-Z][A-Z0-9]*)\b[^>]*>(.*?)</\1>
(Got it from
http://www.regular-expressions.info/examples.html, but basically all it's doing is finding a tag, then matching everything between that tag and it's closing tag using the \1 backreference)
Gah, just reread. You've got that part working already.
What about... (warning, this is really messy and probably won't work)
Code:
<([A-Z][A-Z0-9]*)(\b[^>]*)?(<!--(\b[^>]*)?>)?(\b[^>]*)?>
< to capture the beginning of the tag
([A-Z][A-Z0-9]*) to capture the tag itself (note, you may need to include lower case here)
(\b[^>]*)? to capture anything that does not include a >
(<!--(\b[^>]*)?>)? to capture zero or more words after <!-- but before >, which may never occur
(\b[^>]*)? to capture zero or more words after the html comment
> to capture the end of the tag