请问怎么用ASP判断字符串是否包含汉字
str="aaa中文";
Set reg = New RegExp
reg.Pattern = "[\u4e00-\u9fa5]"
reg.Global = True
reg.IgnoreCase = True
if str.test(reg) then
response.write "含有中文"
end ifFunction CheckExp(patrn, strng)
Dim regEx, Match
Set regEx = New RegExp
regEx.Pattern = patrn
regEx.IgnoreCase = true
regEx.Global = True
Matches = regEx.test(strng)
CheckExp = matches
End Function
Function chkzi2(f_Str)
if Not IsNull(f_Str) Then
if CheckExp("^[^\u4E00-\u9FA5]+$", f_Str)=True then
chkzi2=False '不包含中文
Else
chkzi2=True '包含中文
End If
End If
End Function
