Possible Duplicate:
RegEx match open tags except XHTML self-contained tags
I have a string which is html like this
<html>
<div>
<p>this is sample content</p>
</div>
<div>
<p>this is another sample</p>
<span class="test">this sample should not caught</span>
<div>
this is another sample
</div>
</div>
</html>
now i want to search the word sample
from this string, here i should not get the "sample" which is inside the <span>...</span>
I want this to be done using regex, i tried a lot but i cant do it, any help is greatful.
Thanks in advance.