Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
    
so you want to delete the text something like "Education sdfasdfsa tanks" this? – Siva Charan Feb 17 '12 at 15:54

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

share|improve this answer
  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.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .