I figured that this was a homework question anyway and so a reasonable bit of explanation would allow the student to get away with the numerous variations that exist in real HTML. The OP wants to uppercase his tags. He does not mention attributes so I have left it for him to look at.
A CDATA section is not defined as an HTML tag as defined by the HTML 4 DTD but a <script> tag is which could contain conditional statements (e.g. start < end)that are matched by the regex. Tackling these issues is also something for the guy to look at.