六月婷婷综合激情-六月婷婷综合-六月婷婷在线观看-六月婷婷在线-亚洲黄色在线网站-亚洲黄色在线观看网站

明輝手游網中心:是一個免費提供流行視頻軟件教程、在線學習分享的學習平臺!

使用正則表達式完成模式圖片新聞.ASP

[摘要]'文字或特定圖片模式顯示新聞function shownew(content,ntype)shownew = ""if(ntype = 1) thenshownew = shownew &" <TABLE width=100% >"...

'文字或特定圖片模式顯示新聞

function shownew(content,ntype)

shownew = ""

if(ntype = 1) then

shownew = shownew &" <TABLE width=100% >"
shownew = shownew &"<TR>"
shownew = shownew &" <TD width=600 style='word-break:break-all' valign=top>"&ShowPic(content)&"</TD>"
shownew = shownew &"</TR>"
shownew = shownew &"<TR>"
shownew = shownew &" <TD valign=top style='word-break:break-all'>"&OnlyWord(content)&"</TD>"
shownew = shownew &"</TR>"
shownew = shownew &"</TABLE>"


elseif (ntype = 2) then


shownew = shownew &" <TABLE width='100%'>"

shownew = shownew &"<TR>"
shownew = shownew &" <TD style='word-break:break-all' valign=top>"&OnlyWord(content)&"</TD>"
shownew = shownew &"</TR>"
shownew = shownew &"<TR>"
shownew = shownew &" <TD  width=600 valign=top style='word-break:break-all'>"&ShowPic(content)&"</TD>"
shownew = shownew &"</TR>"
shownew = shownew &"</TABLE>"

elseif (ntype = 3) then


shownew = shownew &"<TABLE>"

shownew = shownew &"<TR>"
 shownew = shownew &"<TD width=100 valign=top>"&ShowPic(content)&"</TD>"

 shownew = shownew &"<TD width=80% style='word-break:break-all' valign=top>"&OnlyWord(content)&"</TD>"


shownew = shownew &"</TR>"
shownew = shownew &"</TABLE>"

elseif (ntype = 4) then

shownew = shownew &"<TABLE>"

shownew = shownew &"<TR>"

  shownew = shownew &"<TD width=80% valign=top style='word-break:break-all'>"&OnlyWord(content)&"</TD>"
 shownew = shownew &"<TD width=100  valign=top>"&ShowPic(content)&"</TD>"

shownew = shownew &"</TR>"
shownew = shownew &"</TABLE>"
else
 shownew = shownew & "<table><tr><td style='word-break:break-all'>"&content&"</td></tr></table>"
end if

end function

'顯示提取的圖片
function ShowPic(strng)

 ShowPic = ""
 ImageUrl= RegExpExecute(strng)

 ImageUrls = Split(ImageUrl,"<BR>")

 for i = LBound(ImageUrls) to (UBound(ImageUrls) - 1)

    ShowPic = ShowPic & ("<a href='"&ImageUrls(i)&"' target=_blank><image src='"&ImageUrls(i)&"' border='0' alt='按此在新窗口瀏覽圖片' onload='javascript:if(this.width>180)this.width=180'></a>")

    next
 
end function


'從內容中提取圖片
Function RegExpExecute(strng)
    Dim regEx, Match, Matches '建立變量。
    Set regEx = New RegExp '建立正則表達式。
      regEx.Pattern = "(src=)(' "&CHR(34)&" )?(.[^' \s "&CHR(34)&"]*)(\.)(jpg gif png bmp jpeg)(' "&CHR(34)&" \s >)?" '設置模式。
   ' regEx.Pattern = "(src=)(' "&CHR(34)&" )?(.[^' "&CHR(34)&"]*)(\.)(jpg gif png bmp jpeg)(' "&CHR(34)&" >)?" '設置模式。
    'regEx.Pattern = "(s S)(r R)(c C)=(' "+CHR(34)+")(\w \\ \/ \.)+(' "+CHR(34)+" * >)?" '設置模式。
    regEx.IgnoreCase = true '設置是否區分字符大小寫。
    regEx.Global = True '設置全局可用性。
    Set Matches = regEx.Execute(strng) '執行搜索。
    For Each Match in Matches '遍歷匹配集合。
       values=values&Match.SubMatches(2)&Match.SubMatches(3)&Match.SubMatches(4)&"<BR>"
    Next
   RegExpExecute = values
End Function

'刪除內容中與圖片有關的代碼
function OnlyWord(strng)
  Set re=new RegExp
  re.IgnoreCase =True
  re.Global=True
 
     re.Pattern = "(<)(.[^<]*)(src=)(' "&CHR(34)&" )?(.[^' \s "&CHR(34)&"]*)(\.)(jpg gif png bmp jpeg)(' "&CHR(34)&" \s >)(.[^>]*)(>)" '設置模式。
  OnlyWord=re.Replace(strng,"")
  Set re= nothing

end function




主站蜘蛛池模板: 亚洲经典在线观看 | 欧美综合在线视频 | 又粗又黄又猛又爽大片app | 亚洲系列第一页 | 日韩精品一区二区三区毛片 | 欧美天天在线 | 亚欧成人一区二区 | 色婷婷综合激情 | 色噜噜狠狠色综合久 | 日韩中文字幕高清在线专区 | 欧美一级爱爱 | 中文字幕福利视频 | 亚洲综合在线最大成人 | 日本激情在线 | 小情侣旅馆内无套啪啪 | 五月激情丁香网 | 日韩一级在线观看 | 日韩美女黄大片在线观看 | 色噜噜狠狠色综合免费视频 | 在线久色| 亚洲精品在线免费 | 日日夜夜天天人人 | 五月天伊人网 | 天堂网在线最新版www中文网 | 色偷偷91综合久久噜噜 | 四虎精品在线观看 | 色综合久久五月 | 青青青影院| 青草青草久热精品视频在线观看 | 深夜爽爽福利gif在线观看 | 亚洲无套 | 天天操天天操 | 又爽又黄无遮挡高清免费视频 | 日日夜夜天天干干 | 亚洲精品老司机在线观看 | 影音先锋色先锋 | 青草社区在线观看 | 欧洲一区麻豆文化传媒 | 一二三四免费观看在线影视大全 | 午夜免费视频观看在线播放 | 伊人网在线播放 |