简体   繁体   English

Notepad ++高级替换功能

[英]Notepad++ advanced replace function

I have this line of code inside an html file and I need to remove some lines from it. 我在html文件中有这行代码,我需要从中删除一些行。

<div class="viewpoint">
<h2>View (2)</h2><a href="./Viewpoints — 100 MOUNT ST160506.nwd_files/vp0002.jpg" title="View (2)"><img src="./Viewpoints — 100 MOUNT ST160506.nwd_files/vp0002.jpg"></a><span class="namevaluepair"><span class="name">Camera Position</span><span class="value">112.933ft,&nbsp;
    93.975ft,&nbsp;
    145.095ft</span></span><div class="comments">
<div class="spacer"></div>
<div class="comment">
<h4>Comment 2</h4><span class="namevaluepair"><span class="name">Status</span><span class="value">New</span></span><span class="namevaluepair"><span class="name">User</span><span class="value">User1</span></span><span class="namevaluepair"><span class="name">Text</span><span class="value">Grid G4 - Level B5</span></span>2016/5/9&nbsp;
  0:45:10</div>
<div class="spacer"></div>
</div>ARC and STR to coordinate slab edge and raft profile<div class="spacer"></div>
</div>

Anything after 之后的一切

</a>

should be removed up to word "Grid...." 应删除到“网格......”这个词。

I tried different methods with no avail. 我尝试了不同的方法但无济于事。

在此输入图像描述

Also, the above code repeats itself many times for each image (ie vp0001.jpg, vp0002.jpg, etc) 此外,上面的代码为每个图像重复多次(即vp0001.jpg,vp0002.jpg等)

Try this: 尝试这个:

Find what: </a>.+?Grid 找到: </a>.+?Grid
Replace with: </a> Grid 替换为: </a> Grid

Search Mode: Regular expression , . matches newline 搜索模式: Regular expression. matches newline . matches newline

在此输入图像描述

This gave the output of 这给了输出

<div class="viewpoint">
<h2>View (2)</h2><a href="./Viewpoints — 100 MOUNT ST160506.nwd_files/vp0002.jpg" title="View (2)"><img src="./Viewpoints — 100 MOUNT ST160506.nwd_files/vp0002.jpg"></a> Grid G4 - Level B5</span></span>2016/5/9&nbsp;
  0:45:10</div>
<div class="spacer"></div>
</div>ARC and STR to coordinate slab edge and raft profile<div class="spacer"></div>
</div>

If this isn't right please update the op with your desired output 如果这不对,请使用您想要的输出更新操作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM