Function Tolink (STR)
Dim RE ' Regular Expression object
Dim strcontent
If IsNull (Str) Then str= ""
Set RE = New RegExp ' Create regular Expression object
With RE
. Global = True ' search applies to entire string
. IgnoreCase = True ' searches for case-insensitive
Strcontent=str
'***************************************************************
' Email address link set up automatically
'***************************************************************
. Pattern= "([w]*) @ ([w.] *)"
Strcontent=. Replace (strcontent, "<a href= ' mailto:$1@$2 ' >$1@$2</A>")
'***************************************************************
' Link Auto Set
'***************************************************************
' = = = = = = = = = = = = Add protocol name =======
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 With
Set re=nothing
Tolink=strcontent
End Function
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.