Shouldn't it be /<h.*?1>?

The regex <.*> matches any characters between < and >. The dot . itself means ‘any single character’. The * means zero or more occurrences of the character. So all together, this expression means zero or more occurences of any character (which even includes h and 1), lying between < and >. But by default regex searches greedy and covers the biggest possible match - which in the greedy case would be <h1 … all the way through…/h1>. But in the lazy case it would look only at the closest possible closing > and not go all the way to the farthest closing >.

1 Like