[英]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? 这可以在Notepad ++中完成,如果是这样,怎么做?
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++). 在搜索窗口中,转到“标记”选项卡(如果缺少,则需要升级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"". 转到菜单项“搜索 - 书签 - >”删除书签行“”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.