Reputation: 31
I'm editing a long list of 5 numbers in Notepad but need to remove every line that begins with 2. How do I do this? Example list below...
1 9 11 18 29
2 9 11 18 29
3 9 11 18 29
4 9 11 18 29
5 9 11 18 29
6 9 11 18 29
1 2 12 18 29
2 3 12 18 29
2 4 12 18 29
1 5 12 18 29
Upvotes: 2
Views: 258
Reputation: 11336
Use Notepad++ regex Find-and-Replace:
Find what:
^2[\s\S]+?^(?=\d)
Replace it with nothing.
Upvotes: 0
Reputation: 405765
Find ^2 (.*)$
and replace with nothing. This will replace each list of five numbers starting with a 2
with a blank line.
Alternatively, you can go to the Mark tab on the Search dialog, Bookmark the lines that match the pattern above, then Search > Bookmark > Remove Bookmarked Lines. This will completely remove lines that start with 2
.
Upvotes: 2