asp檢測是否為中文字符函數
更新時間:2009年02月21日 03:46:55 作者:
檢測是否為中文字符
<%
'******************************
'函數: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
%>
'******************************
'函數: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
%>
相關文章
FormatRemoteUrl函數之asp實現格式化成當前網站完整的URL-將相對地址轉換為絕對地址的代碼
FormatRemoteUrl函數之asp實現格式化成當前網站完整的URL-將相對地址轉換為絕對地址的代碼...2007-09-09
ASP之處理用Javascript動態(tài)添加的表單元素數據的代碼
ASP之處理用Javascript動態(tài)添加的表單元素數據的代碼...2007-11-11

