Is it possible to remove every line in a notepad++ document that has a specific character in it? For example, in my document I have something like:
是否可以删除记事本++文档中具有特定字符的每一行?例如,在我的文档中,我有类似的东西:
test1@gmail.com:cool
cool:cool
test2@yahoo.com:cool
I want to get rid of all lines that have the character "@" in them, so after it would look just like this:
我想摆脱所有字符“@”的行,所以在它看起来像这样:
cool:cool
2 个解决方案
#1
Yes there is.
就在这里。
Regex: Remove lines containing
正则表达式:删除包含的行
-
Search > Find > Mark
搜索>查找>马克
-
In the "Find what" textfield, enter "@"
在“查找内容”文本字段中,输入“@”
-
Check the "Bookmark line" and "Wrap around" checkboxes
选中“书签行”和“环绕”复选框
Mark All
-
Now select Search > Bookmark > Remove Bookmarked Lines"
现在选择搜索>书签>删除书签行“
#2
In find and replace, regex mode:
在查找和替换中,正则表达式模式:
Find: ^.*@.*$(\r\n)?
Replace with:
找:^。* @。* $(\ r \ n)?用。。。来代替:
Output:
cool:cool
#1
Yes there is.
就在这里。
Regex: Remove lines containing
正则表达式:删除包含的行
-
Search > Find > Mark
搜索>查找>马克
-
In the "Find what" textfield, enter "@"
在“查找内容”文本字段中,输入“@”
-
Check the "Bookmark line" and "Wrap around" checkboxes
选中“书签行”和“环绕”复选框
Mark All
-
Now select Search > Bookmark > Remove Bookmarked Lines"
现在选择搜索>书签>删除书签行“
#2
In find and replace, regex mode:
在查找和替换中,正则表达式模式:
Find: ^.*@.*$(\r\n)?
Replace with:
找:^。* @。* $(\ r \ n)?用。。。来代替:
Output:
cool:cool