1

I want to delete chunks of text in a single text file that Start with "Education" and end with "tanks" and have variable data in between.

Any suggestions?

MikeD
  • 11

2 Answers2

1

The regular expression I believe you want to use is as simple as: education.*tank

I downloaded TextPad, but for some reason when I did a "Search" with this regular expression it would work. But when I did the same search with the "Replace" function it "could not find it".

I got it to work in Notepad++, though. Just click Search -> Replace (Ctrl+H), and then enter the expression education.*tank and then nothing (or a space) in Replace. From there you can use "Find Next" to see if the matches are correct and hit "Replace All" from there.

Those are the steps for Notepad++; if the Replace function works for you in TextPad the steps are similar

Atif
  • 372
0
  1. Click the icon or hit F8 to open the Replace dialog box.
  2. Type 'education.*tanks' (without the quote marks) in the "Find what:" box.
  3. Leave the "Replace with:" box blank.
  4. Uncheck the "Match case" box.
  5. Check the "Regular expression" box.
  6. Click "Replace All".

This works for me in tests.

I think the previous answer is essentially right, but neglected checking the RegEx box.