How do I perform the action in Notepad++ of deleting all lines except lines with different terms?
问题:
回答1:
Open the search dialogue and select the Mark tab. In the Find what field enter a search string to find the lines to be kept. The question is not really clear, should those strings be at the start of the lines or the end or anywhere in the lines. Enter either ^:(([0-5][05])|60)
or ^:(([0-5][05])|60)$
or :(([0-5][05])|60)
respectively. Make sure that Bookmark line and Regular expression are selected, then click Mark all. Next visit the menu => Search => Bookmark => Remove unmarked lines.
The search strings look for a colon followed by some digits. The digits can be either any of 012345 followed by any of 05 or they can be explicitly 60. Note that 65 is not required hence the simpler regular expression :[0-6][05]
cannot be used.
回答2:
You can always use regex in the find-replace, something like
^[^:][^0-6][^05]