Page 1 of 1

Deleting varying text between two fixed tags

Posted: Thu Mar 30, 2017 2:32 am
by regex
Hi,

I have this on one line:
<h3>South-West High</h3>

I want to keep the h3 tags, and replace the text between them, with:
Summer Clases. The text varies per file as the schools have different names.

I tried searching this forum and found something that's the opposite.

I also want to know how to replace between two tags or phrases which are multiline.

What do I search/find, and what do I replace - in terms of the regex code as I am a noob.

Thanks

Re: Deleting varying text between two fixed tags

Posted: Thu Mar 30, 2017 12:03 pm
by DigitalVolcano
You can replacing the heading tags like this:

RegEx

Code: Select all

<h3>.*?</h3>
Replace

Code: Select all

<h3>New Text</h3>
If you checkmark the option 'Dot matches newline' then the H3 tag to be replaced can span multiple lines.

Re: Deleting varying text between two fixed tags

Posted: Thu Mar 30, 2017 6:17 pm
by regex
Thank you very much.

It works perfectly.

Have an awesome weekend. :)