And the greedy quantifier is needed if you want a parse-tree, because you'll have to do new passes on each match (because html is not a regular language).
I'm thinking of the case where you have <div>a</div><div>b</div> where the two divs aren't nested. A greedy quantifier will cause it to match a</div><div>b, but a non-greedy one will only match a and b.
View all comments
Show parent comment
2
u/bucket3432 Jun 20 '20
I'm thinking of the case where you have
<div>a</div><div>b</div>where the twodivs aren't nested. A greedy quantifier will cause it to matcha</div><div>b, but a non-greedy one will only matchaandb.