There is a sample html code like below:
<div><span>span1</span></div>
<b>for test</b>
<span>span2</span>
Is there any way to get all span tags that are not in div tags (In this sample: span2)
According to this post C# Regular Expression excluding a string this is my pattern but it does not work.
pattern: ((?:(?!\b<div>\b))*)((.|\n)*?)<span>((.|\n)*?)</span>((.|\n)*?)((?:(?!\b</div>\b))*)