2010. 4. 13. 14:31
ASP 정규표현식 사용
2010. 4. 13. 14:31 in 팁&테크/ETC
function autolink_function(str)
dim reg
set reg = New RegExp
reg.pattern =
"(http|ftp)://([a-z0-9_-./~@?=%&:-]+)"
reg.Global = True
reg.IgnoreCase = True
str = reg.Replace(str,
"<a href='$1://$2' target=new>$1://$2</a>")
reg.pattern =
"([a-z0-9_-.]+)@([a-z0-9_-.]+)"
str = reg.Replace(str,
"<a href='mailto:$1@$2';>$1@$2</a>")
autolink_function = str
end function