[ASP] Classic ASP Autolink
function autoLink(str)
strRegExp = "http(s)?://([a-zA-Z0-9\~\!\@\#\$\%\^\&\*\(\)_\-\=\+\\\/\?\.\:\;\'\,]*)?"
strOutput = "<a href='http$1://$2' target='_blank'>http$1://$2</a>"
autoLink= reg_replace(str,strRegExp,strOutput,true)
end function
function reg_replace(strOriginalString, strPattern, strReplacement, varIgnoreCase)
'Function replaces pattern with replacement
'varIgnoreCase must be TRUE (match is case insensitive) or FALSE (match is case sensitive)
dim objRegExp : set objRegExp = new RegExp
with objRegExp
.Pattern = strPattern
.IgnoreCase = varIgnoreCase
.Global = True
end with
reg_replace = objRegExp.replace(strOriginalString, strReplacement)
set objRegExp = nothing
end function