kola popa
kola popa

Reputation: 1

Remove all without the regex notepad++

I have the following list:

"site": "https://example.com",
"site": "https://example2.com",
"site": "*.example4.com",
"site": "https://example.com5",
"site": "*.example6.com",

I want to use notepad++ and regex and leave only the lines that start with "site": "*.

I have the following code:

"site": "[*].*"

I am looking for what I want to keep but I don't know how to use it to remove everything else.

Upvotes: 0

Views: 55

Answers (1)

AdrianHHH
AdrianHHH

Reputation: 14038

Use the "Mark" tab of the search panel (keyboard shortcut Ctrl+M). Enter ^"site": "\* into the "Find what". Ensure that all of "Bookmark line", "Wrap around" and "Regular expression" are selected. Click on "Mark all". Expect to see blue circles at the left of all marked lines. Use menu => Search => Bookmark => Remove Unmarked Lines; could also access the menu by right-clicking on any blue circle.

To summarise, mark the line to be kept then remove the unmarked lines.

Upvotes: 4

Related Questions