asp 實(shí)現(xiàn)檢測(cè)字符串是否為純字母和數(shù)字組合的函數(shù)
更新時(shí)間:2007年08月08日 12:04:31 作者:
<%
'******************************
'函數(shù):CheckString(strng)
'參數(shù):strng,待驗(yàn)證字符串
'作者:阿里西西
'日期:2007/7/13
'描述:檢測(cè)字符串是否為純字母和數(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
%>
檢測(cè)是否為中文字符
<%
'******************************
'函數(shù):CheckChinese(strng)
'參數(shù):strng,待驗(yàn)證字符
'作者:阿里西西
'日期:2007/7/13
'描述:檢測(cè)是否為中文字符,返回值:中文為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,待驗(yàn)證字符串
'作者:阿里西西
'日期:2007/7/13
'描述:檢測(cè)字符串是否為純字母和數(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
%>
檢測(cè)是否為中文字符
<%
'******************************
'函數(shù):CheckChinese(strng)
'參數(shù):strng,待驗(yàn)證字符
'作者:阿里西西
'日期:2007/7/13
'描述:檢測(cè)是否為中文字符,返回值:中文為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ù)端上的各類(lèi)文件的實(shí)現(xiàn)方法
asp在IE瀏覽器中下載服務(wù)端上的各類(lèi)文件的實(shí)現(xiàn)方法...2007-11-11
Active Server Pages 錯(cuò)誤 ''ASP 0201'' 修復(fù)方法
網(wǎng)上很多其他的解決方法, 但是我試了幾個(gè)小時(shí), 都沒(méi)有解決問(wèn)題, 最后是通過(guò)這個(gè)方法解決的.2010-07-07
用asp腳本實(shí)現(xiàn)限制IP訪問(wèn)
用asp腳本實(shí)現(xiàn)限制IP訪問(wèn)...2007-06-06
ASP ACCESS 日期操作語(yǔ)句小結(jié) By Stabx
ASP ACCESS 日期操作語(yǔ)句小結(jié) By Stabx...2006-10-10
asp實(shí)現(xiàn)計(jì)算兩個(gè)時(shí)間內(nèi)的工作日的函數(shù)
asp實(shí)現(xiàn)計(jì)算兩個(gè)時(shí)間內(nèi)的工作日的函數(shù)...2007-08-08

