简体   繁体   中英

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.

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.

Just open replace dialog window.

Select Regular expression and tick . matches newlines .

Into find what type: Bank.*Applicants

Click replace all.

i think you want to do some programatically

This may be help you :

Click here

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM