(?=<p>).*?(XXXX).*(YYYY) <p><strong><span style="color: #0000ff;"><strong>This XXXX To Remove YYYY Starting With "<p>"</strong></p> <p><strong><span style="color: #0000ff;"><strong>BlahBlahBlah</strong></p>
<br>
<p><strong><span style="color: #0000ff;"><strong>BlahBlahBlah</strong></p>
<br>
<p><strong><span style="color: #0000ff;"><strong>This XXXX To Remove YYYY Starting With "<p>"</strong></p>
<br>
<p><strong><span style="color: #0000ff;"><strong>BlahBlahBlah</strong></p>
<br>
<br>
<p><strong><span style="color: #0000ff;"><strong>This XXXX To Remove YYYY Starting With "<p>"</strong></p>
<br>
<p><strong><span style="color: #0000ff;"><strong>BlahBlahBlah</strong></p>
<br> [edited by: Brett_Tabke at 5:27 pm (utc) on Nov 13, 2015]
I can't isolate the particular "starting" <p> I want from the other's..
<p><strong><span style="color: #0000ff;"><strong>BlahBlahBlah</strong></p>
<br>
<p class = "myclass">blahblah</p>
and your RegEx becomes (I don't speak CGI so I don't know if anything needs escaping) (<p class = "myclass">[^<\n]*)(XXXX[^<\n]*YYYY)([^<\n]*</p>
I captured three pieces: everything before the X-to-Y element, the X-to-Y element itself, and everything after. It wasn't clear from your post which bits you're changing. The ^\n is just for insurance; once you've said ^< it should be redundant.