Sukanta Roy Sujan
Sukanta Roy Sujan

Reputation: 61

replace everything between two words and also two words in notepad++

I have a text like this

0367118 06 - 10 000071
Bank sl. no beginning with an 'IA' indicates ICB account
Paramount Textile Limited Page No: 113 of 258
Lottery Conducted by--Dept. of Electrical and Electronic Engineering, BUET. Date:03/10/2013
General
Applicants
0367121 06 - 10 000074

want make it like this in Notepad++ using replace and regular expression

0367118 06 - 10 000071
0367121 06 - 10 000074

want to replace all between two word Bank and Applicants and also those word too with none.

Upvotes: 2

Views: 10003

Answers (5)

Wanghz
Wanghz

Reputation: 21

Bank.*Applicants does work except unchecking "matchs new line", so what you need to do is to check this box. I test it on Notepad ++ 6.4.5.

Upvotes: 2

Brian Stephens
Brian Stephens

Reputation: 5271

I think you are looking for a more generic solution than specifically replacing on the words "Bank" and "Applicants". Otherwise, you would do this manually.

So here's how to search for that type of code and replace what's in between:

Find:    (\d+ \d+ - \d+ \d+\r\n).*?(\d+ \d+ - \d+ \d+\r\n)
Replace: \1\2

Be sure you are using the "regular expression" mode, with ". matches newline" checked.

Upvotes: 0

fred02138
fred02138

Reputation: 3371

var result = text.replace(/(.*)Bank.+Applicants(.+)/, function(m,p1,p2) { return p1+p2;});

Upvotes: 0

kaushik0033
kaushik0033

Reputation: 677

i think you want to do some programatically

This may be help you :

Click here

Upvotes: 0

topr
topr

Reputation: 4622

Just open replace dialog window.

Select Regular expression and tick . matches newlines.

Into find what type: Bank.*Applicants

Click replace all.

Upvotes: 0

Related Questions