<META http-equiv=Content-Type content="text/html; charset=utf-8">
<%
Dim str
str = "<div title='欢迎访问,码农库。 www.MaNongKu.com' class='desc'>"
response.write f_GetChinese(True, str)
'Gloabl:搜索全局,str:被检索字符串
Function f_GetChinese(ByVal global,ByVal str)
Dim reg, macher, count, i, temp
temp = ""
Set reg = New RegExp
reg.Pattern = "[\u4e00-\u9fa5]+"
reg.Global=global
Set macher = reg.Execute(str)
count = macher.count
If count > 0 Then
For i = 0 To count - 1
temp=temp&macher(i)
Next
End If
f_GetChinese = temp
End Function
%>
运行结果:
欢迎访问码农库