如何删除 notepad++ 或 Emeditor 中不包含电子邮件类型的所有行
完整示例文件包含:
[email protected]:password1
[email protected]:password5
[email protected]:password2
[email protected]:password3
[email protected]:password4
user1:password1
user2:password2
user3:password3
所需结果:
[email protected]:password1
[email protected]:password5
[email protected]:password2
[email protected]:password3
[email protected]:password4
答案1
以下是完成这项工作的方法:
- Ctrl+H
- 找什么:
^[^@]+$
- 用。。。来代替:
EMPTY
- Replace all
解释:
^ : begining of line
[^@]+ : 1 or more character that is not @
$ : end of line
- 请勿检查
. matches newline
给定示例的结果:
[email protected]:password1
[email protected]:password5
[email protected]:password2
[email protected]:password3
[email protected]:password4