I am looking for a regex for Javascript to search for text ("span" for example) in HTML.
Example:
<div>Lorem span Ipsum dor<a href="blabla">la
blala</a> dsad <span>2</span> ... </div>
BUT only the "span" after "Lorem" should be matched, not the <span>
tag.
For a second example, if we search for "bla", only the bold text should be matched.
The HTML is gotten by innerHTML, the matchings will be surrounded with <span class="x">$text</span>
, an then rewritten to innerHTML of this node, and all these without killing the other tags.
I wrote my own search, it is searching char by char, with cache and flags.
Thanks for ure Help guys!