asp 实现检测字符串是否为纯字母和数字组合的函数
2007-08-08 12:04
786 查看
<%
'******************************
'函数:CheckString(strng)
'参数:strng,待验证字符串
'作者:阿里西西
'日期:2007/7/13
'描述:检测字符串是否为纯字母和数字组合
'示例:<%=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
%>
检测是否为中文字符
<%
'******************************
'函数:CheckChinese(strng)
'参数: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
%>
'******************************
'函数:CheckString(strng)
'参数:strng,待验证字符串
'作者:阿里西西
'日期:2007/7/13
'描述:检测字符串是否为纯字母和数字组合
'示例:<%=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
%>
检测是否为中文字符
<%
'******************************
'函数:CheckChinese(strng)
'参数: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
%>
相关文章推荐
- asp 实现检测字符串是否为纯字母和数字组合的函数
- Asp检测字符串是否为纯字母和数字组合函数
- 此函数用来判断传入的字符串参数是否全是字母数字的组合
- asp.net 验证字符串是否为纯数字检测函数
- asp.net 验证字符串是否为纯数字检测函数
- 有一字符串包含字母,数字,编程实现取出数字;使用函数,指针实现
- shell 函数实现检测字符串是否为合法的 IPv4 地址
- JS实现生成由字母与数字组合的随机字符串功能详解
- 金山笔试题-字符串排序 :" 写一个函数,实现对给定的字符串(字符串里面包括:英文字母,数字,符号)的处理"
- ASP 检测字符串是否包括汉字、数字、韩文、日文,以及其他语种字符的方法
- C#正则检测字符串是否字母数字混编的方法
- ASP 检测字符串是否包括汉字、数字、韩文、日文,以及其他语种字符的方法
- 正则匹配密码只能是数字和字母组合字符串功能【php与js实现】
- 通过程序统计字符串的大写字母个数、小写字母个数、数字个数和其它字符个数。用函数func实现功能
- php如何判断字符串是否是字母和数字的组合
- 一句代码,实现在文本框中仅能键入数字和字母组成的字符串
- ASP.NET通过自定义函数实现对字符串的大小写切换功能
- (原创)检测字符串是否包含有数字
- 检测是否还有黑客代码的asp.net函数
- Python判断字符串是否为字母或者数字(浮点数)的多种方法