2009. 12. 28. 13:59
function AutoLink (content)

dim re
Set re = New RegExp

' First Pass for http
re.Pattern = "(\w+):\/\/([^/:]+)(:\d*\b)?([^# \n<]*).*\n"
re.Pattern = "([0-9a-zA-Z./@:~?&=_-]+)"
re.Pattern = "http://([0-9a-zA-Z./@:~?&=_-]+)"
re.Global = True
re.IgnoreCase = True

'
ASP seems to be not supporting .MultiLine method.
're.MultiLine = True

content = re.Replace(content,"<a target=_blank href='
http://$1'>http://$1</a>")

' Second Pass for mail
re.Pattern = "([_0-9a-zA-Z-]+(\.[_0-9a-zA-Z-]+)*)@([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*)"
AutoLink = re.Replace(content,"<a href='
mailto:$1@$3'>$1@$3</a>")

end function

Posted by ToTb