ASP汉字检测函数

 

Function RegChinese(str)
    Dim regEx, retVal
    Set regEx = New RegExp
    regEx.Pattern = "^[^\u0000-\u00FF]*$"
    regEx.IgnoreCase = False
    retVal = regEx.Test(str)
    If retVal Then
        RegChinese = True '是汉字
    Else
        RegChinese = False '不是汉字
    End If
End Function
posted @ 2007-12-06 10:21  missthe  阅读(261)  评论(0编辑  收藏  举报