I'm trying to parse a DOM and replace parts of the text with tokens, for example detect an email then replace it with {{EMAIL}} string without changing the HTML Given the following HTML (for example, can be different):
<div dir="ltr" style="direction: ltr; text-align: left;">
this is <span style="font-style:italic;">my</span>
email <span title="bla@bla.com" style="font-weight:bold;">bla@bla.com </span>
</div>
How can I replace just the test portion so it to would be:
<div dir="ltr" style="direction: ltr; text-align: left;">
this is <span style="font-style:italic;">my</span>
email <span title="bla@bla.com" style="font-weight:bold;">{{EMAIL}} </span>
</div>