How to find an element contains a string? by regex.
for example, i want to find elements contains string:
<div class="a"><span id="d">string</span></div>
<span style="color: red;">string</span>
<p class="c">string</p>
it should return: <span id="d">string</span>, <span style="color: red;">string</span>, <p class="c">string</p>.
thanks.
The almost closest:
But it can fail on several badly formatted examples. And you should read one of the best answers on this topic.
HTH