in reply to (**corrected**) What Does This Line Do?
This will match a like that contains zero or more open tags, followed by a <H1>, another block of zero or more tags, and then a word. The $3 mentioned on the print line "checking for cat" will note the word after all the tags.