Disclosure: I have read this answer many times here on SO and I know better than to use regex to parse HTML. This question is just to broaden my knowledge with regex.
Say I have this string:
some text <tag link="fo>o"> other text
I want to match the whole tag but if I use <[^>]+>
it only matches <tag link="fo>
.
How can I make sure that >
inside of quotes can be ignored.
I can trivially write a parser with a while loop to do this, but I want to know how to do it with regex.