How to replace between certain text : <p>Ok i have some text like below:</p>

<p>&amp; leftsidetext sometext rightsidetext &amp; %leftsidetext sometext rightsidetext%</p>

<p>Now i want to replace replacetext inside sometext just in: 
&amp; leftsidetext sometext rightsidetext &amp;</p>
