Ændre lidt i pattern
HejJeg kan ikke få den til at matche, fordi mit pattern ikke er helt korrekt. Men da jeg ikke ved noget om reg.exp. kan jeg ikke selv ændre det.
PS. Der er en bug i eksperten, så den sommetider fjerner et af de to aprostroffer, som står ved siden af hinanden.
___________________________________________________________
<%
dim myarr(10)
tekst = "<a id=""listlinks"" target=""_scurl"" href=""http://www.enHjemmeside.com/enSide.htm""> <a id=""listlinks"" target=""_scurl"" href=""http://www.toHjemmeside.dk/""> <a id=""listlinks"" target=""_scurl"" href=""http://www.treHjemmeside.com/sub/enSide.htm"">"
i = 0
Function LinkToString(strInput)
Set objRegExpHTTP1 = New RegExp
objRegExpHTTP1.Global = True
objRegExpHTTP1.IgnoreCase = True
objRegExpHTTP1.Pattern = "(.*?)(http://www.|http://)(.*?)(\.)(.*?)(>)"
strOutput = objRegExpHTTP1.Replace(strInput, "$3")
set objRegExpHTTP1 = Nothing
LinkToString = strOutput
End Function
Set objRegExp = New RegExp
objRegExp.Global = True
objRegExp.IgnoreCase = True
objRegExp.Pattern = "(.*?)(id=""listlinks"" target=""_scrul"" href="")(http://www.|http://)(.*?)(\.)(.*?)(>)"
set matches = objRegExp.Execute(tekst)
for each match in matches
myarr(i) = LinkToString(match.value)
i = i+1
next
set objRegExp = Nothing
for i = 0 to UBound(myarr)
response.write myarr(i) & "<br>"
next
%>
