improve HTML tag detection regular expression

Previous regular expression failed to match when response body had
uppercase <HTML> tag or if the tag had attributes.