dede 关于批量替换 正则表达式 解决方案
采集时候没过滤 table ttable tr td 等表格的
想把这些删除 不影响页面效果
用正则如何替换 主表的字段是什么
希望过手解决下 网上资料很少 都无效 再次发帖求助
table ttable tr td 或者怎么替换才能有效去除它的功效呢
我记得以前有个 <table *****>改成< --!table***>什么的忘记了
类似这样的也可以 解决下啊
———————————————————————————————————————————
———————————————————————————————————————————
这是我在处理文章时用到一些正则表达式,里面有你要的。在Editplus中使用。
在表:dede_addonarticle中,body字段即是文章内容。
过滤Table相关的:
正则: width=\"[0-9][0-9][0-9]\"| width=[0-9][0-9][0-9]| height=\"[0-9][0-9][0-9]\"| height=[0-9][0-9][0-9],说明:过虑height、Width。
------------------------------------------------------
正则:<div style=\"[^>]*\">|<div [^>]*>|</div>|<div>,注意:匹配<div style="">或者<div id="">。
------------------------------------------------------
正则: style=\"[^"]*\"| style=[^"]*,注意:匹配Style="border:"
------------------------------------------------------
正则:<style([^>]*)>(.*)</style> ,注意:匹配<style type="text/css"></style>
------------------------------------------------------
正则:<font [^>]*>|<font>|</font>|<strong [^>]*>|<strong>|</strong> ,注意:匹配<font>和<strong>
------------------------------------------------------
正则: border="[0-9]"| border=[0-9],注意:匹配border=""
------------------------------------------------------
正则:<span [^>]*>|<span>|</span> ,注意:匹配<span>
------------------------------------------------------
正则: id=[^ ]*| id=\"[^ ]*\",注意:匹配id=“”
------------------------------------------------------
正则: title=[0-9][^ ]*| title=\"[0-9][^ ]*\"| alt=[0-9][^ ]*| alt=\"[0-9][^ ]*\"| alt=[a-z][^ ]*| alt=\"[a-z][^ ]*\",注意:匹配Title或者alt
------------------------------------------------------
正则:<!--[^>]*-->,说明:匹配HTML注释
------------------------------------------------------
正则:<script([^>]*)>(.*)</script>,说明:匹配<script></script>之间的全部内容
------------------------------------------------------
正则: class=[a-z][^ |^>]*| class=\"[a-z][^ |^>]*\",说明:清理class="",经过充分测试
------------------------------------------------------
正则:<table([^>]*)>|</table>|<td>|</td>|<tbody>|</tbody>|<tr>|</tr>
------------------------------------------------------
正则:<h2 [^>]*>|<h2>|</h2>| align=left|<em>|</em>|<center>|</center>|<a([^>]*)>|</a>
------------------------------------------------------