Regular Expression
1. 匹配 URL 并替换, www. 不超过四可正常工作, 或者说不超过三级域名, 本正则可正常工作
2. email 替换操作, 三级域名或以内, 本正则正常工作
---/---------------------------------------------------------
2. email 替换操作, 三级域名或以内, 本正则正常工作
'email 替换操作, email 替换为 <a href=mailto:email>email</a>
Set re = New RegExp
re.Pattern = "([\w-]+\.+[\w-]+\@+)([\w-]+\.+[\w-]+\.+|[\w-]+\.+)([\w{1}][\w{2}][\w{3}]|[\w{1}][\w{2}])"
re.Global = true
re.IgnoreCase = true
result = re.Replace(result,"<a href=mailto:$1$2$3>$1$2$3</a>")
----------------------
'EMAIL 解码
Set re = New RegExp
re.Pattern = "(\<a href\=mailto\:)([\w-]+\.+[\w-]+\@+)([\w-]+\.+[\w-]+\.+|[\w-]+\.+)([\w{1}][\w{2}][\w{3}]|[\w{1}][\w{2}])(\>)(.*)(\<\/a\>)"
re.Global = true
re.IgnoreCase = true
Str = re.Replace(Str,"$6")
1. 匹配 URL 并替换, www. 不超过四可正常工作, 或者说不超过三级域名, 本正则可正常工作
'url 替换操作, www 替换为 <a href=http://www>www</a>
Set re = New RegExp
re.Pattern = "(http\:\/\/|^http\:\/\/)([\w-]+\.+[\w-]+\.+[\w-]+\.+[\w-]+|[\w-]+\.+[\w-]+\.+[\w-]+)(/[\w-./?%&=]*)?"
re.Global = true
re.IgnoreCase = true
result = re.Replace(result,"<a href=http://$2$3 target=_blank>$1$2$3</a>")
----------------------
'URL 解码
Set re = New RegExp
re.Pattern = "(\<a href\=\http\:\/\/)([\w-]+\.+[\w-]+\.+[\w-]+\.+[\w-]+|[\w-]+\.+[\w-]+\.+[\w-]+)(/[\w-./?%&=]*)?( target\=\_blank\>)(http\:\/\/|^http\:\/\/)([\w-]+\.+[\w-]+\.+[\w-]+\.+[\w-]+|[\w-]+\.+[\w-]+\.+[\w-]+)(/[\w-./?%&=]*)?(/[\w-./?%&=]*)(\<\/a\>)"
re.Global = true
re.IgnoreCase = true
Str = re.Replace(Str,"$5$6$7$8")
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''