Asp检测字符串是否为纯字母和数字组合函数

来源:互联网 发布:ubuntu 安装低版本gcc 编辑:程序博客网 时间:2024/05/18 00:18
 '******************************
'函数:CheckString(strng)
'参数:strng,待验证字符串
'描述:检测字符串是否为纯字母和数字组合
'示例:<%=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
原创粉丝点击