asp檢測是否為中文字符函數(shù)
更新時間:2009年02月21日 03:46:55 作者:
檢測是否為中文字符
<%
'******************************
'函數(shù):CheckChinese(strng)
'參數(shù):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
%>
'******************************
'函數(shù):CheckChinese(strng)
'參數(shù):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
%>
相關(guān)文章
巧用FileSystem組件實現(xiàn)WEB應(yīng)用中的本地特定打印的方法
巧用FileSystem組件實現(xiàn)WEB應(yīng)用中的本地特定打印的方法...2007-04-04A利用ASP小偷和Google實現(xiàn)在線翻譯功能的代碼
A利用ASP小偷和Google實現(xiàn)在線翻譯功能的代碼...2007-11-11