| 发表于:2008-01-16 11:30:53 楼主 |
<% dim tempstr tempstr=" <p> 新闻内容 <img height="高度是变化的" width="宽度也是变化的" alt="" src="/news/pic/2008-1/image/fl200801070943422936.gif" /> </p> " dim objregexp set objregexp=new regexp objregexp.ignorecase = true objregexp.global = true objregexp.pattern=" <img src='.+?'> " set matches = objregexp.EXECute(tempstr) objregexp.pattern="src='.+?'" for each match in matches set matches1=objregexp.EXECute(match.value) aa=aa & replace(replace(matches1(0).value,"src=",""),"'","") &"@" next aa=left(aa,len(aa)-1) response.write(aa) &" <br> " bb=split(aa,"@") for i=0 to ubound(bb) response.write(bb(i)) &" <br> " next %> -----------------------上面的正则表达式,是要读取新闻内容中的图片的路径,新闻内容是会变的,也就是要判断有没有图片,如果有的话不同的新闻内容图片的高度和宽度是会变化的。 |
|
|
|
|