<%
'Add link to the URL in the field.
Function tolink (STR)
Dim re 'regular expression object dim strcontent
If isnull (STR) Then STR = ""
Set Re = new Regexp 'create a regular expression object
With re
. Global = true' search applies to the entire string
. Ignorecase = true' search case-insensitive
Strcontent = Str
'*************************************** ************************
'Mail Address link is automatically set
'*************************************** ************************
. Pattern = "([\ W] *) @ ([\ W \.] *)"
Strcontent =. Replace (strcontent, "<a href = 'mailto: $1 @ $2 '> $1 @ $2 </a> ")
'*************************************** ************************
'Automatic link settings
'*************************************** ************************
'====== Add the protocol name as required ======
Dim D (3), I
D (0) = "HTTP"
D (1) = "ftp"
D (2) = "news"
D (3) = "MMS"
'==========================================
For I = 0 to ubound (d)
. Pattern = d (I) + ": \/([\ W \.] *)"
Strcontent =. replace (strcontent, "<a href = '" + d (I) + ": // $1 'target = _ blank>" + d (I) + ": // $1 </a> ")
Next
'*************************************** ************************
End
Set Re = nothing
Tolink = strcontent
End Function
%>