我使用 nginx subs 过滤器模块从页面中删除 html 标记。
标签是:
<div id="header">
紧随其后的是:
<div id="mainscreen">
我试过了 :
subs_filter <div\ id=\"header\">.*<div\ id\"mainscreen\"> <div\ id=\"mainscreen\"> r;
subs_filter <div\ id=\"header\">(.*)<div\ id\"mainscreen\"> <div\ id=\"mainscreen\"> r;
subs_filter <div\ id=\"header\">(.*?)<div\ id\"mainscreen\"> <div\ id=\"mainscreen\"> r;
subs_filter <div\ id=\"header\">(.*?\n)*<div\ id\"mainscreen\"> <div\ id=\"mainscreen\"> r;
但没有任何改变。
这是我要删除的内容:
<div id="header">
<div id="topline">
<div class="topleft">
<a class="about-link" onclick="UI.show_about(this);return false" id="rcmbtn100" href="#">A propos</a>
</div>
<div class="topright">
<span class="username">michee.test@test.com</span>
<a class="button-logout" id="rcmbtn101" href="./?_task=logout" onclick="return rcmail.command('switch-task','logout',this,event)">Déconnexion</a>
</div>
</div>
<div id="topnav">
<div id="taskbar" class="topright">
<a class="button-mail" id="rcmbtn102" href="./?_task=mail" onclick="return rcmail.command('switch-task','mail',this,event)"><span class="button-inner">Courriel</span></a>
<a class="button-addressbook" id="rcmbtn103" href="./?_task=addressbook" onclick="return rcmail.command('switch-task','addressbook',this,event)"><span class="button-inner">Carnet d'adresses</span></a>
<a class="button-settings" id="rcmbtn104" href="./?_task=settings" onclick="return rcmail.command('switch-task','settings',this,event)"><span class="button-inner">Paramètres</span></a>
<a class="button-logout" id="rcmbtn105" href="./?_task=logout" onclick="return rcmail.command('switch-task','logout',this,event)"><span class="button-inner">Déconnexion</span></a>
<span class="minmodetoggle"></span>
</div>
<img src="skins/larry/images/roundcube_logo.png" id="toplogo" border="0" alt="Logo" onclick="rcmail.command('switch-task','mail');return false;">
</div>
<br style="clear:both" />
</div>
<div id="mainscreen">