RegEx to replace only inside certain tags?
If there is something like
<h1>Text Text <b>Bold Text</b> Text Text</h1>
<p>Text Text <b>Bold Text</b> Text Text</p>
Q: is there a way to replace (delete) the <b> and </b> only if they are inside the h1 tags?
I got this far
Find: (<[Hh][1-6]>)(.+?)(<[biu]>)(.+?)(</\3>)(.+?)<(</[Hh][1-6]>)
Replace: \1\2\4\6\7
but it doesn't work because I can't figure out how to get the red back reference to match the blue tag
Q2: is there a better way?
|