You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Notepad++中删除匹配指定内容的文本(含重复与唯一行)

How to Delete All Lines Containing Specific Emails (Duplicates + Unique) in Notepad++

Got it, let's tackle this problem step by step—you need to wipe out every single line (whether it's a duplicate or unique entry) that includes any of your 100+ target email addresses in Notepad++. Here's the most efficient way to do it:

Step 1: Turn Your Email List into a Regex Pattern

Since you have dozens of emails to match, we'll use a regular expression with "OR" logic to catch all of them at once:

  1. Take your list of target emails (e.g., test1@test.com, test3@test.com, test5@test.com).
  2. For each email, escape the dot characters (. becomes \.) because in regex, a dot matches any character. So test1@test.com becomes test1@test\.com.
  3. Join all these escaped emails with a pipe | (this means "match any of these"). Your final pattern snippet will look like:
    test1@test\.com|test3@test\.com|test5@test\.com|...
    

Step 2: Use Notepad++'s Find/Replace with Regex

Now let's apply this to delete the matching lines:

  • Open your target file in Notepad++.
  • Press Ctrl+H to open the Find/Replace dialog.
  • In the Search Mode section, select Regular expression (make sure the . matches newline box is unchecked—we don't want to match across lines).
  • In the Find what field, wrap your regex snippet with ^.* and .*$ to match the entire line that contains any of your target emails. The full pattern will look like:
    ^.*(test1@test\.com|test3@test\.com|test5@test\.com|...).*$
    
  • Leave the Replace with field completely empty—this tells Notepad++ to delete the matched lines.
  • Click Replace All—boom, every line with any of your target emails (duplicate or unique) will be removed instantly.

Pro Tip to Avoid Mistakes

Before hitting Replace All, click Find All in Current Document to preview exactly which lines will be deleted. This lets you double-check that your regex is targeting the right lines before making changes. Always back up your original file too—better safe than sorry!

内容的提问来源于stack exchange,提问作者Stew

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.28 07:11:29