手机
当前位置:查字典教程网 >编程开发 >ASP教程 >asp 实现检测字符串是否为纯字母和数字组合的函数
asp 实现检测字符串是否为纯字母和数字组合的函数
摘要:检测是否为中文字符

<%

'******************************

'函数:CheckString(strng)

'参数:strng,待验证字符串

'作者:阿里西西

'日期:2007/7/13

'描述:检测字符串是否为纯字母和数字组合

'示例:<%=CheckString(strng)%>

'******************************

FunctionCheckString(strng)

CheckString=true

DimregEx,Match

SetregEx=NewRegExp

regEx.Pattern="^[A-Za-z0-9]+$"

regEx.IgnoreCase=True

SetMatch=regEx.Execute(strng)

ifmatch.countthenCheckString=false

EndFunction

%>

检测是否为中文字符

<%

'******************************

'函数:CheckChinese(strng)

'参数:strng,待验证字符

'作者:阿里西西

'日期:2007/7/13

'描述:检测是否为中文字符,返回值:中文为true,否则false

'示例:<%=CheckChinese(strng)%>

'******************************

FunctionCheckChinese(strng)

CheckChinese=true

DimregEx,Match

SetregEx=NewRegExp

regEx.Pattern="||#|&|?|@|%|*|/|.|,|;|'|:|-|_|+|^|""|=|<|>|"

regEx.IgnoreCase=True

SetMatch=regEx.Execute(strng)

ifmatch.countthenCheckChinese=false

EndFunction

%>

【asp 实现检测字符串是否为纯字母和数字组合的函数】相关文章:

ASP 非法字符过滤函数

asp 常用的字符串处理函数

判断字符串中相同字符的个数

把字符串转换成数据库SQL语句格式

由给定的字符串生成关键字

asp中向文本框输出数据原样式的函数

asp实现获取MSSQL数据库表指定条件行数的函数

asp 中常用的文件处理函数

asp中的Rnd 函数

用ASP实现对ORACLE数据库的操作

精品推荐
分类导航