asp 實現(xiàn)檢測字符串是否為純字母和數(shù)字組合的函數(shù)
更新時間:2007年08月08日 12:04:31 作者:
<%
'******************************
'函數(shù):CheckString(strng)
'參數(shù):strng,待驗證字符串
'作者:阿里西西
'日期:2007/7/13
'描述:檢測字符串是否為純字母和數(shù)字組合
'示例:<%=CheckString(strng)%>
'******************************
Function CheckString(strng)
CheckString = true
Dim regEx, Match
Set regEx = New RegExp
regEx.Pattern = "^[A-Za-z0-9]+$"
regEx.IgnoreCase = True
Set Match = regEx.Execute(strng)
if match.count then CheckString= false
End Function
%>
檢測是否為中文字符
<%
'******************************
'函數(shù):CheckChinese(strng)
'參數(shù):strng,待驗證字符
'作者:阿里西西
'日期:2007/7/13
'描述:檢測是否為中文字符,返回值:中文為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ù):CheckString(strng)
'參數(shù):strng,待驗證字符串
'作者:阿里西西
'日期:2007/7/13
'描述:檢測字符串是否為純字母和數(shù)字組合
'示例:<%=CheckString(strng)%>
'******************************
Function CheckString(strng)
CheckString = true
Dim regEx, Match
Set regEx = New RegExp
regEx.Pattern = "^[A-Za-z0-9]+$"
regEx.IgnoreCase = True
Set Match = regEx.Execute(strng)
if match.count then CheckString= false
End Function
%>
檢測是否為中文字符
<%
'******************************
'函數(shù):CheckChinese(strng)
'參數(shù):strng,待驗證字符
'作者:阿里西西
'日期:2007/7/13
'描述:檢測是否為中文字符,返回值:中文為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)文章
asp在IE瀏覽器中下載服務(wù)端上的各類文件的實現(xiàn)方法
asp在IE瀏覽器中下載服務(wù)端上的各類文件的實現(xiàn)方法...2007-11-11
Active Server Pages 錯誤 ''ASP 0201'' 修復(fù)方法
網(wǎng)上很多其他的解決方法, 但是我試了幾個小時, 都沒有解決問題, 最后是通過這個方法解決的.2010-07-07
ASP ACCESS 日期操作語句小結(jié) By Stabx
ASP ACCESS 日期操作語句小結(jié) By Stabx...2006-10-10
asp實現(xiàn)計算兩個時間內(nèi)的工作日的函數(shù)
asp實現(xiàn)計算兩個時間內(nèi)的工作日的函數(shù)...2007-08-08

