Lasse
Fri Oct 08 07:07:00 CDT 2004
SROSeaner,
Function LinkURL(stringa)
Dim objRegExp, strTemp
Set objRegExp = New RegExp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "(\b(www\.|http\://)\S+\b)"
strTemp = objRegExp.replace(stringa, "<A HREF='
http://$1'
class='orangelnk' TARGET='_new'>$1</A>")
LinkURL = Replace(strTemp, "
http://http://","http://")
Set objRegExp = Nothing
End Function
"SROSeaner" <SROSeaner@discussions.microsoft.com> wrote in message
news:C4757E34-F004-4F62-95C2-F3B54F2C375C@microsoft.com...
> I am working on an ASP page which looks in a set of text for web page
URLs.
>
> Using the VBScript.RegExp regular expression object, I have this regular
> expression:
>
> [a-z]+\.[a-z]+\.[a-z]+/
>
> And it works well finding URL's such as: windowsupdate.microsoft.com,
> www.cnn.com, etc.
>
> However, I have been trying to modify it to ALSO find URL's like this:
>
> www.amazon.com/index/sell/ie6.html?val=1
> Or
> www.microsoft.com/windowsxp
>
> Any ideas?