主页 > 知识库 > asp 实现检测字符串是否为纯字母和数字组合的函数

asp 实现检测字符串是否为纯字母和数字组合的函数

热门标签:Mysql连接数设置 Linux服务器 阿里云 科大讯飞语音识别系统 电子围栏 银行业务 团购网站 服务器配置
%
'******************************
'函数: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 实现检测字符串是否为纯字母和数字组合的函数》,本文关键词  ;如发现本文内容存在版权问题,烦请提供相关信息告之我们,我们将及时沟通与处理。本站内容系统采集于网络,涉及言论、版权与本站无关。
  • 相关文章
  • 收缩
    • 微信客服
    • 微信二维码
    • 电话咨询

    • 400-1100-266