正则表达式提取网址、标题、图片等一例(.Net Asp Javascript/Js)的实现 - 文章中心
正则表达式提取网址、标题、图片等一例(.Net Asp Javascript/Js)的实现
2024-12-20

正则表达式提取网址、标题、图片等一例(.Net Asp Javas<em></em>cript/Js)的实现

<%
Dim str, reg, objMatches
str = "<li><a href="https://www.jb51.net/article/"http://localhost/Z-Blog18/article/143.htm"" title=""FCKEditor高亮代码插件测试""><span class=""article-date"">[09/11]</span>FCKEditor高亮代码插件测试</a></li>"
Set reg = new RegExp
reg.IgnoreCase = True
reg.Global = True
reg.Pattern = "http://([^s]+)"".+?span.+?[(.+?)].+?>(.+?)<"
Set objMatches = reg.Execute(str)
If objMatches.Count > 0 Then
Response.Write("网址:")
Response.Write(objMatches(0).SubMatches(0))
Response.Write("<br>")
Response.Write("日期:")
Response.Write(objMatches(0).SubMatches(1))
Response.Write("<br>")
Response.Write("标题:")
Response.Write(objMatches(0).SubMatches(2))
End If
%>
  I   II   III   IV