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

how to delete lines not contaning :

match1:follow
Star3:night
master
Hunt:Bock3
Roll

want to keep only lines with :


Solution 1:

  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

Solution 2:

  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