Notepad++ 查找并删除行中的重复项?

Notepad++ 查找并删除行中的重复项?,notepad++,Notepad++,我有一个文件,重复相同的术语以“0/0***结束jpg”开始。我想执行一个命令并删除一个术语 <h2> 3. USS Midway Museum </h2> "0/0.003.jpg" "0/0.003.jpg" : meunierd / shutterstock USS Midway Museum The longest-s

我有一个文件,重复相同的术语以“0/0***结束jpg”开始。我想执行一个命令并删除一个术语

<h2>
            3. USS Midway Museum
        </h2>
            "0/0.003.jpg"   "0/0.003.jpg"    
            : meunierd / shutterstock
            USS Midway Museum
            The longest-serving aircraft carrier in the world has been permanently moored at San Diego’s Embarcadero since 2004. Commissioned in 1945, the USS Midway served in the Vietnam War and Operation Desert Storm, before becoming the largest museum dedicated to aircraft carriers and naval aviation anywhere.
            GetYourGuide.com offers a    >self-guided audio tour of this humungous vessel, during which you’ll see over 30 restored aircraft, including 8 propeller planes, 14 jet aircraft and 8 helicopters.
            You’ll be led through the galley, brig, crew’s sleeping quarters, pilots’ ready rooms and engine room, and hear exciting snippets from people who served aboard the Midway.
            You’ll have lots of chances to get involved, testing simulators, climbing into cockpits and watching films documenting the dramatic events that took place where you stand.
        <h2>
            4. Point Loma
        </h2>
            "0/0.004.jpg"   "0/0.004.jpg"    
            : S.Borisov / shutterstock
            Point Loma Lighthouse
            The west side of San Diego Bay is embraced by a long rocky peninsula that merits a visit for jagged topography, thrilling history and views you won’t soon forget.
            We’ll touch on a few of the sights on Point Loma later, but in 1542, this was the landing point for the first European expedition to what is now the West Coast of America.
            Given the peninsula’s setting, protecting the west flank of the harbour, Point Loma has a military presence going back to the 19th century.
            The 77.5-acre Fort Rosecrans National Cemetery (1882) is on the grounds of a former coastal artillery station.
            There are more than 100,000 graves here, and solemn memorials like the USS Bennington Monument, recording an accident in San Diego Bay that claimed 66 lives in 1905. Head to the marina for whale watching expeditions, and to Osprey Point were climbers scale the rocks and fishers camp over the water.
            Available tour:    >GPS Talking Tour Cars: Point Loma &amp; Beaches Loop
        <h2>
            5. La Jolla
        </h2>
            "0/0.005.jpg"   "0/0.005.jpg"    
            : Dancestrokes / shutterstock

3.美国军舰中途岛博物馆
“0/0.003.jpg”“0/0.003.jpg”
:meunierd/shutterstock
美国军舰中途岛博物馆
自2004年以来,世界上服役时间最长的航空母舰一直停泊在圣地亚哥的Embarcadero。1945年服役的“中途岛”号曾在越南战争和“沙漠风暴行动”中服役,后来成为世界上最大的航空母舰和海军航空博物馆。
GetYourGuide.com提供了一个>这艘巨大船只的自助音频之旅,在此期间,您将看到30多架修复的飞机,包括8架螺旋桨飞机、14架喷气式飞机和8架直升机。
你将被引导穿过厨房、驾驶舱、船员的寝室、飞行员的候机室和机舱,听到在中途号上服役的人们的激动人心的片段。
你将有很多机会参与其中,测试模拟器,爬进驾驶舱,观看记录你所处位置发生的戏剧性事件的电影。
4.洛马角
“0/0.004.jpg”“0/0.004.jpg”
:S.Borisov/shutterstock
洛马角灯塔
圣地亚哥湾的西侧被一个长而多岩石的半岛所环抱,崎岖的地形、激动人心的历史和你不会很快忘记的风景值得一游。
稍后我们将谈到洛马角的一些景点,但在1542年,这是欧洲第一次远征美国西海岸的登陆点。
考虑到半岛的背景,保护海港的西侧,洛马角的军事存在可以追溯到19世纪。
占地77.5英亩的罗斯克兰斯堡国家公墓(1882年)位于前海岸炮兵站的地面上。
这里有超过100000座坟墓,还有庄严的纪念馆,如美国军舰本宁顿纪念碑,记录了1905年在圣地亚哥湾发生的一次事故,造成66人死亡。前往码头观看鲸鱼探险,到了鱼鹰角,登山者爬上岩石,渔民在水面上扎营。
可用游览:>GPS有声游览车:Point Loma&;海滩环线
5.拉霍拉
“0/0.005.jpg”“0/0.005.jpg”
:舞曲/百叶窗

可以使用记事本++替换正则表达式。 像这样的事情应该可以做到:

搜索:

("[0-9]+\/[0-9]+\.[0-9]+\.jpg")\s+\1
替换为:

\1
这意味着:查找至少一个数字的实例,后跟斜杠,后跟一个或多个数字,后跟一个点号(.),后跟一个或多个数字,后跟一个点号(.),然后是“jpg”。捕获这个表达式(括号就是这样做的)。这个表达式后面应该有一些空格(至少一个空格),并在同一行上重复一次。 请注意,点(.)在正则表达式中是一个特殊字符,与斜杠(/)类似,它用反斜杠()转义

\1
表示要捕获的表达式

因此,

替换为:

"0/0.003.jpg"
这只是一个例子,可以更加严格和改进。这个正则表达式实际上会留下一些可能不需要的空白,尽管这不会有什么坏处。

  • Ctrl+H
  • 查找内容:
    (“0/0.*.jpg”)\h+\1
  • 替换为:
    $1
  • 检查环绕
  • 检查正则表达式
  • 取消选中
    。匹配换行符
  • 全部替换
说明:

(           # start group 1
    "0/0    # literally
    .*?     # 0 or more any charactr but newline
    \.jpg"  # literally
)           # end group 1
\h+         # 1 or more horizontal spaces
\1          # backreference to group 1

我简化了课文,只保留了相关部分。 屏幕截图(之前):

(           # start group 1
    "0/0    # literally
    .*?     # 0 or more any charactr but newline
    \.jpg"  # literally
)           # end group 1
\h+         # 1 or more horizontal spaces
\1          # backreference to group 1

屏幕截图(之后):

(           # start group 1
    "0/0    # literally
    .*?     # 0 or more any charactr but newline
    \.jpg"  # literally
)           # end group 1
\h+         # 1 or more horizontal spaces
\1          # backreference to group 1

可以编写一个程序来完成这项工作。。。或者我想正则表达式搜索会有帮助。。