user964946
user964946

Reputation: 69

In Notepad++, removing any text not matching a certain string on each line?

I have something like:

oiuerer jeff oteaweawe
gnwaeeeee jeff nbbaweee
bbbadx  jeff nvxxawee

I would like to remove the text which is both before and after the word "jeff" so that each line is only "jeff". How can I do this with regex? Thanks

Upvotes: 2

Views: 3292

Answers (2)

Rusty Fausak
Rusty Fausak

Reputation: 7525

Press Ctrl+h to open this dialog.

Replace using Notepad++ regex

Upvotes: 4

corsiKa
corsiKa

Reputation: 82589

Replace .*jeff.* with jeff?

enter image description here

enter image description here

Upvotes: 4

Related Questions