{I+=codeWee;}
[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
HTML | PHP | C++ | DirectX11 | Javascript | C# | HTML5 | ASP | SQL | General | CSS | Oculus Rift | Unity3d | Virtools SDK | Tip | NSIS | PowerShell | node.js | Web API | RTSP | All
Copyright© 2016 CodeWee.com All rights reserved.