How to Delete Lines Not Containing ":" in notepad++

5

1

how to delete lines not contaning :

match1:follow
Star3:night
master
Hunt:Bock3
Roll

want to keep only lines with :

DeathRival

Posted 2017-07-11T10:14:58.523

Reputation: 113

Answers

6

  1. Open find replace dialog (CTRL+H)
  2. Check "Regular expression"
  3. Find what:
    ^[^:]*$
  4. Replace with:
    (empty)
  5. press "replace all"

enter image description here

Máté Juhász

Posted 2017-07-11T10:14:58.523

Reputation: 16 807

thanks so much Máté Juhász its get the job done i appreciate it – DeathRival – 2017-07-11T10:43:33.207

If you're interested in how that works, [^:] matches any character except a colon so the while thing matches lines where every character is not-a-colon. – Darael – 2017-07-11T11:28:55.047

3

  1. Control+F, go to "MARK" tab
  2. Find what : :
  3. check the box against "bookmark line"
  4. click "Mark all"

All lines containing : will be highlighted.

  1. Now, go to "Search" menu >> bookmark >> remove unmarked line.

Voila!

Reference: https://stackoverflow.com/a/8231096/8307806
Thanks to Colin

miteshB666

Posted 2017-07-11T10:14:58.523

Reputation: 41