简体   繁体   中英

Remove all lines without an @ character in Notepad++

I have a list like:

asd@asd
abcdefgh
abcde@fgh
ijklmnop

I want to remove all lines without the symbol @ . The result should be:

 asd@asd
 abcde@fgh

Can this be done in Notepad++, and if so, how?

Try looking for:

^[^@]*$

and replacing with an empty string.

使用以下正则表达式查找和替换:

^[^@]*$

In the search window, goto the "Mark" tab (If it is missing, you need to upgrade your Notepad++).

Select "Bookmark Line" and "Regular Expression", use the regular expression you already got

^[^@]*$

Press "Mark all"

This results in bookmarks for all Lines with no @ .

Goto the menu point "Search - Bookmark -> "Remove Bookmarked Lines"".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM