Eric Abraham
Eric Abraham

Reputation: 31

RegEx - How to select/remove all lines that contains only numbers?

I have a huge list like this. I want to remove the lines that have only numbers. How can I do that? I'm using Notepad++. So, if possible, please give me a solution that will work on Notepad++

List:

dog.belt.b79
dog.food
7902823429
dog.hoodie.722
1898261
dog.collar
dogbelt
80862
doghoodie.89
42111556

I want:

dog.belt.b79
dog.food
dog.hoodie.722
dog.collar
dogbelt
doghoodie.89

I tried to Google it. But nothing really helps.

Upvotes: 0

Views: 915

Answers (2)

Andrej Kesely
Andrej Kesely

Reputation: 195438

Try:

\s*^\s*\d+\s*$

and replace it with empty string.

enter image description here

enter image description here

Upvotes: 0

help-info.de
help-info.de

Reputation: 7260

You'd go through following steps:

  • Ctrl+H
  • Find what: ^\d+\R
  • Replace with: NOTHING
  • Search mode: Regular expression
  • Click on Replace All (at your own risk)

is resulting in:

enter image description here

Upvotes: 1

Related Questions