i've got a webpage that i would like to modify by code (adding link on specific words).
The HTML code:
<div class="section">
<h2>Notre histoire</h2>
<p style="text-align: justify;">SPECIFICS WORDS<strong>1998 : la création</strong></p>
<p style="text-align: justify;">pour objectif « de promouvoir, selon une démarche d’éducation active, auprès des jeunes et à travers eux, des projets d’expression collective et d’action de solidarité » (article 2).<br><br><strong>1999-2001 : les débuts SPECIFICS WORDS</strong></p>
<p style="text-align: justify;">SPECIFICS WORDS<a href="#">SPECIFICS WORDS</a></p>
</div>
So my aim is to preg_replace on SPECIFIC WORDS, but only those who are IN a P, but out from a A or a STRONG, or any either tags.
I can't use any class, or any id because i don't know the code before! I tried preg_replace PHP function, but it didn't work, and was too long to execute.
So my question is: How to select with XPATh a node without its A, STRONG, IMG chidrens ?