QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 3093|回复: 0

如何删除以下格式内容?

[复制链接]
发表于 2012-8-17 09:28:45 | 显示全部楼层 |阅读模式
处理格式:
<h2 class="def-header">
<span>Definition of <em>-ABILITY</em>
</span>
</h2>



<span class="ssens"> <strong>:</strong> capacity, fitness, or tendency to act or be acted on in a (specified) way <span class="vi">&lt;agglutin<em>ability</em>&gt;</span> </span>

<h2>
<span>Browse</span>
</h2>

<span>Next Word in the Dictionary: <a href="/dictionary/Ahom">Ahom</a>
</span>
<br />
<span>Previous Word in the Dictionary: <a href="/dictionary/aholehole">aholehole</a>
</span>
<br />
<span>All Words Near: <a href="/browse/dictionary/-aholic">-aholic</a>
</span>


<h2>
<span>

<span class="ssens"> <strong>:</strong> replacing carbon especially in a ring <span class="vi">&lt;az<em>a-</em>&gt;</span> </span>



<h2>
<span>Browse</span>
</h2>

<span>Next Word in the Dictionary: <a href="/dictionary/algic acid">algic acid</a>
</span>
<br />
<span>Previous Word in the Dictionary: <a href="/dictionary/algeroba">algeroba</a>
</span>
<br />
<span>All Words Near: <a href="/browse/dictionary/-algia">-algia</a>
</span>


<h2>
<span>

<h2>-ability</h2> <span class="main-fl"> <em xmlns:mwref="http://www.m-w.com/mwref">noun suffix</em> </span>

注意:
开头格式必须:
<h2>
<span>Browse</span>
</h2>
结束格式必须:
<h2>
<span>
符合以上条件时才删除内容。

结果:
删除以上格式内容,变成如下:
<h2 class="def-header">
<span>Definition of <em>-ABILITY</em>
</span>
</h2>


<span class="ssens"> <strong>:</strong> capacity, fitness, or tendency to act or be acted on in a (specified) way <span class="vi">&lt;agglutin<em>ability</em>&gt;</span> </span>

<span class="ssens"> <strong>:</strong> replacing carbon especially in a ring <span class="vi">&lt;az<em>a-</em>&gt;</span> </span>



<h2>-ability</h2> <span class="main-fl"> <em xmlns:mwref="http://www.m-w.com/mwref">noun suffix</em> </span>

本人常用的是sed,当然如果sed无法完成。麻烦写一下awk或perl
您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-12-1 14:49 , Processed in 0.036023 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表