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

01
<%
02
'******************************
03
'函数:CheckString(strng)
04
'参数:strng,待验证字符串
05
'描述:检测字符串是否为纯字母和数字组合
06
'示例:CheckString(strng)
07
'******************************
08
Function CheckString(strng)
09
CheckString = true
10
Dim regEx, Match
11
Set regEx = New RegExp
12
regEx.Pattern = “1+$”
13
regEx.IgnoreCase = True
14
Set Match = regEx.Execute(strng)
15
if match.count then CheckString= false
16
End Function
17
'******************************
18
'函数:CheckChinese(strng)
19
'参数:strng,待验证字符
20
'描述:检测是否为中文字符,返回值:中文为true,否则false
21
'示例:CheckChinese(strng)
22
‘******************************
23
Function CheckChinese(strng)
24
CheckChinese = true
25
Dim regEx, Match
26
Set regEx = New RegExp
27
regEx.Pattern = "||#|&|?|@|%|*|/|.|,|;|’|:|-|_|+|^|""|=|<|>|\ "
28
regEx.IgnoreCase = True
29
Set Match = regEx.Execute(strng)
30
if match.count then CheckChinese= false
31
End Function
32
%>
本文原创自news.mkq.online
版权声明:本文为原创文章,版权牛站新闻所有
转载请注明http://www.niuzhan.com/keji/


  1. A-Za-z0-9 ↩︎

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值