网络编程 
首页 > 网络编程 > 浏览文章

asp检测是否为中文字符函数

(编辑:jimmy 日期: 2024/10/9 浏览:3 次 )
<%
'******************************
'函数:CheckChinese(strng)
'参数:strng,待验证字符
'描述:检测是否为中文字符,返回值:中文为true,否则false
'示例:<%=CheckChinese(strng)%>
'******************************
Function CheckChinese(strng)
CheckChinese = true
Dim regEx, Match
Set regEx = New RegExp
regEx.Pattern = "\||\#|\&|\?|\@|\%|\*|\/|\.|\,|\;|\'|\:|\-|\_|\+|\^|\""|\=|\<|\>|\ "
regEx.IgnoreCase = True
Set Match = regEx.Execute(strng)
if match.count then CheckChinese= false
End Function
%>
上一篇:ASP 包含文件中的路径问题和使用单一数据库连接文件的解决方案
下一篇:asp 过滤非法字符函数