求一正则 如何过滤一段代码 100分求助

kite123 2006-09-03 12:06:24
比如我要把下面这段代码过滤掉,正则应该怎么写

<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="750">
<tr>
<td width="156" valign="top" bgcolor="#F7F7F7">
<table border="0" cellpadding="2" cellspacing="0" style="border-collapse: collapse" width="100%">
<tr>
<td width="100%" bgcolor="#999999">
<img border="0" src="images/d_1.gif" width="13" height="13" align="absmiddle">
<font color="#FFFFFF"><FONT color=#ffffff><B>推荐软件</B></FONT>
<FONT color=#FFFF00>Cool!</FONT></font></td>
</tr>
<tr>
<td width="100%"><script language=javascript src="ads/js_index_left.js"></script></td>
</tr>
</table>
...全文
248 6 打赏 收藏 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
btbtd 2006-09-03
  • 打赏
  • 举报
回复
分拿来....

<form name="form1" method="post" action="?id=test">
<textarea name="txa" cols="50" rows="10">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- DW6 -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
</head>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="750">
<tr>
<td width="156" valign="top" bgcolor="#F7F7F7">
<table border="0" cellpadding="2" cellspacing="0" style="border-collapse: collapse" width="100%">
<tr>
<td width="100%" bgcolor="#999999">
<img border="0" src="images/d_1.gif" width="13" height="13" align="absmiddle">
<font color="#FFFFFF"><font color=#ffffff><b>推荐软件</b></font>
<font color=#FFFF00>Cool!</font></font></td>
</tr>
<tr>
<td width="100%"><script language=javascript src="ads/js_index_left.js"></script></td>
</tr>
</table></center>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- DW6 -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
</head></textarea>
<br>
<input type="submit" name="Submit" value="Submit">
</form><br>
<a href="?">back</a><p/>
<%
dim id
id=request.queryString("id")
if id<>"" then
dim txa
txa=request.form("txa")
function fRegExpSgl(str,glb,igc,mtl,pt,rpt)
dim re
set re=new RegExp
re.global=glb
re.ignoreCase=igc
re.multiline=mtl

re.pattern=pt
fRegExpSgl=re.replace(str,rpt)
set re=nothing
end function 'shawl.qiu code'
response.write "<xmp>"
response.write fRegExpSgl(txa,true,true,false,"\<div align\=""center""\>[\s\S]*?\<center\>[\s\S]*?\<table.*?width\=""750""\>[\s\S]*?src\=""ads\/.*?\.js[\s\S]*?<\/table\>","")
response.write "</xmp>"
end if
%>
btbtd 2006-09-03
  • 打赏
  • 举报
回复
哈哈, 很容易, mark 一下, 等一下弄.
iasky 2006-09-03
  • 打赏
  • 举报
回复
全部替换
weiqiaoxyz 2006-09-03
  • 打赏
  • 举报
回复
你这个是不是也太长了?

用REPLACE不是更好~!

xuStanly 2006-09-03
  • 打赏
  • 举报
回复
btbtd((不结帐∨(裤衩1->马甲)∨装B)>80%=沉默;hou 'o__ |o|)
你强,每次都是先占位再来解决问题。

上次帮我的时候也这样:
================================================================================
btbtd((不结帐∨(裤衩1->马甲)∨装B)>80%=沉默;hou 'o__ |o|) ( ) 信誉:100 Blog 2006-8-30 11:34:47 得分: 0



如果没人竞争就好了 :), 等一下我就弄.
================================================================================



jinjuduo 2006-09-03
  • 打赏
  • 举报
回复
mark

28,402

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧