I need to match words in HTML but need to skip a tag (with specific class) and its contents. Example:
<p> There is my way <span class="abc"> way beyond someone </span></p>
I need to match only first way
word. Till now i am using word boundary to select word. /\b(way)\b/ig
but it fails in below scenario.
<p> There is nothing. <span class="abc"> Way beyond someone </span></p>
In this statement i don;t want to match anything because way
is inside the span.abc
element.
I have tried ^
operator but doesn't seems to work. i.e. /(\b)way(\b)^("abc">the)/ig