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)文章
ReplaceTrim 函數(shù)之a(chǎn)sp實(shí)現(xiàn)過(guò)濾掉字符中所有的tab和回車(chē)和換行的代碼
ReplaceTrim 函數(shù)之a(chǎn)sp實(shí)現(xiàn)過(guò)濾掉字符中所有的tab和回車(chē)和換行的代碼...2007-09-09ASP基礎(chǔ)入門(mén)第二篇(ASP基礎(chǔ)知識(shí))
這篇文章是ASP基礎(chǔ)入門(mén)第二篇,第一篇展示了ASP動(dòng)態(tài)網(wǎng)站設(shè)計(jì)的一些最基本的方法,相信通過(guò)實(shí)踐各位對(duì) ASP 已經(jīng)有了最基本的了解,本文將進(jìn)一步介紹ASP動(dòng)態(tài)網(wǎng)站的一些基本技巧,需要的朋友可以參考下2015-10-10asp下根據(jù)標(biāo)題生成關(guān)鍵字的代碼
實(shí)現(xiàn)的功能是:標(biāo)題+標(biāo)題里除去非中文及中文標(biāo)點(diǎn)外的字符的、相鄰兩個(gè)字符的集合 傳說(shuō)中這是采集文章處理keywords的最佳方式,呵呵,做了一個(gè),用下試試2008-06-06asp中通過(guò)fso讀取和生成UTF-8編碼的txt
利用fso.OpenTextFil讀取UTF-8文件或者用FSO.save生成UTF-8文件時(shí)亂碼解決辦法生成靜態(tài)頁(yè)使用的方法是讀取asp頁(yè)面的html代碼,保存為html文件,這種方法2013-08-08ASP 程序?qū)崿F(xiàn)自動(dòng)升級(jí)功能
ASP 程序?qū)崿F(xiàn)自動(dòng)升級(jí)功能...2006-10-10