I think I kinda understood it ?!
1.a greedy match finds the longest possible part of a string that fits the regex pattern and returns it as a match.
2.The alternative is called a lazy match, which finds the smallest possible part of the string that satisfies the regex pattern.
the default is greedy matching, and it is finding the max number of characters between a < and a > (as the patter is /<.*>/)
so it is getting everything between the first < at the beginning of the string, to the last > at the end of the string, it is matching the whole <h1>Winter is coming</h1> because it is greedy
instead you want to get only the opening tag <h1>, to make the match lazy