regex101.com is a really good resource for seeing a regular expression broken down. For example:
< matches the character < literally . matches any character (except for line terminators) *? matches the previous token between zero and unlimited times, as few times as possible, expanding as needed (lazy) > matches the character > literally
I’m not sure what you mean. Do you mean that it seems like it should be /<>.*?/? Can you explain why that is?
This pattern has been written to match any html tag. If you did /<h1>/, then it would only match an opening header tag. You could also match opening and closing h1 tags by modifying that.