请教:这样的两个规则能合并成一个规则不?
Posted: Jan 19 2011, 15:39
假设有在段需要过滤的代码如下:
我制订过滤规则如下:
考虑到 <div id="ad"> 的广告通用性,假如 Limit 大于 2560 ,就用CSS来隐藏。就制订了另一个规则放在上面规则的后面:
请问:这样的两个规则能合并成一个规则吗?谢谢!
Code: Select all
<div id="ad">00000000</div>
Code: Select all
[Patterns]
Name = "ad_div 1"
Active = TRUE
URL = "$TYPE(htm)"
Bounds = "<div\s$INEST(<div *>,</div>)</div>"
Limit = 2560
Match = "<div[^>]++\sid=$AV(ad)*"
Code: Select all
[Patterns]
Name = "ad_div 2"
Active = TRUE
URL = "$TYPE(htm)"
Bounds = "<div\s[^>]+>"
Limit = 100
Match = "<div[^>]++\s(id=$AV(ad))\1 *>"
Replace = "<div \1 style="display:none;">"