28,391
社区成员
发帖
与我相关
我的任务
分享
Dim regex, matches, found, str
str = "http://www.***.comftp://www.***.comhttp://www.***.comhttp://www.***.com"
Set re = New RegExp
re.Pattern = "ftp\://.+?(?=http\://|$)"
Set matches = re.Execute(str)
If matches.Count Then
found = matches.Item(0).Value
Response.Write found
Else
' 没有匹配
End If
Set matches = Nothing
Set re = Nothing
<%str="http://www.***.comftp://www.***1.comhttp://www.***.comhttp://www.***.com"
Set re = new RegExp
re.IgnoreCase = True
re.Global = True
re.Pattern ="ftp:\/\/(.+)\.comhttp"
Set Matches = re.Execute(str)
str=Matches(0)
Set re = Nothing
Set re = new RegExp
re.IgnoreCase = True
re.Global = True
re.Pattern ="http(.*?)http"
response.Write re.Replace(str,"")
Set re = Nothing
%>
str="http://www.***.comftp://www.***1.comhttp://www.***.comhttp://www.***.com"
Set re = new RegExp
re.IgnoreCase = True
re.Global = True
re.Pattern ="ftp:\/\/(.+)\.comhttp"
Set Matches = re.Execute(str)
str=Matches(0)
Set re = Nothing
Set re = new RegExp
re.IgnoreCase = True
re.Global = True
re.Pattern ="http(.*?)http"
response.Write re.Replace(str,"")
Set re = Nothing