| 域名空间 下载中心 社区论坛 信息公告 my小屋 |
![]() |
联系我们 设为首页 加入收藏 |
|
首页 | 新闻资讯 | 编程开发 | 网页设计 | 图形图象 | 网络媒体 | 网站模板 | 数 据 库 | 投稿 论坛 | 操作系统 | 系统优化 | 网络安全 | 黑客技术 | 硬件学堂 | 硬件报价 | 服 务 器 | 地图 专题 | 应用软件 | 聊天通讯 | q q 专栏 | 建站经验 | 在线工具 | 站长club | 注 册 表 | 旧版 社会 | 游戏娱乐 | 设计欣赏 | 疑难解答 | 社区论坛 | 网络赚钱 | 网站地图 | 广告服务 | 服务 |
| 新版上线![旧版] | |||||
注:打开慢时请稍等
|
' 以前写全文检索程序的时候写的. ' 原创 by 飞鸟@dev-club.com ' email: flybird@dev-club.com ' ie5.5 脚本引擎 required dim patern dim found dim str dim result patern="(a)|(b)" str=" a dog fall in love with a cat. can you believe?" result="" call getmatchtext(str,result,false) response.write result sub getmatchtext(byref str,byref result,isneedtrunc) 'on error resume next dim regex, match, matches dim tstr set regex = new regexp ' 建立正则表达式。 regex.pattern = (patern) ' 设置模式。 regex.ignorecase = true ' 设置是否区分字符大小写。 regex.global = true ' 设置全局可用性。 set matches = regex.execute(str) ' 执行搜索。 if err.number<>0 then response.write "错误1:" & err.description err.clear exit sub end if if matches.count <>0 then dim startindex dim mymatchvalue startindex=1 for each match in matches if (instr(str,match.value)>0) then if instr(str,match.value)-50 >0 then startindex=instr(str,match.value)-50 else startindex=1 end if mymatchvalue=match.value exit for end if next if isneedtrunc then result= (mid(str,startindex,strlength(mymatchvalue)+100)) else result= (str) end if for each match in matches if not(instr(result,"<font color=red>" & match.value & "</font>")>0) then result=replace(result,match.value,"<font color=red>" & match.value & "</font>" ) end if next found=true else found=false end if set regex=nothing end sub %> 编辑: [发送给好友] [打印本页] [关闭窗口] [返回顶部] 上一篇:js判断输入日期的正确性 下一篇:lcid地区代码 转载请注明来源:www.iyit.net 特别声明: 本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员,我们尽快予以更正。 |
| 相关文章 | ||||
| 友情链接 | ||||||
| 设置首 页 - 版权声明 - 广告服务 - 关于我们 - 联系我们 - 友情连接 |
| |||||||