求正则匹配

amu1433 2010-12-08 10:01:01
<textarea name="nf_info" class="InputBox1" id="nf_info" style="width:100%; height:145px;" onKeyUp="value=value.replace(/[^\u4E00-\u9FA5]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\u4E00-\u9FA5]/g,''))"></textarea>



这是个文本框 只允许字母 跟数字


我想改成 只允许汉字 跟字母(主要是防止填入电话号码等数字信息)
不能有电话信息
...全文
72 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
后浪 2010-12-08
  • 打赏
  • 举报
回复
哥们你名字我第一次看到就笑了..
十一文 2010-12-08
  • 打赏
  • 举报
回复
恭喜 jf
yhtapmys 2010-12-08
  • 打赏
  • 举报
回复
恭喜 JF
amu1433 2010-12-08
  • 打赏
  • 举报
回复
Function repnum(strng) '以数组返回
i = 0
Set regEx = New RegExp
regEx.Pattern = "(\d+)" '"[0-9]"
regEx.IgnoreCase = True
regEx.Global = True
Set Matches = regEx.Execute(strng)
For Each Match in Matches
'RetStr = RetStr &"<br>"& Match.Value
If Len(Match.Value)>=5 Then
strng = Replace(strng, Right(Match.Value,4),"***")
End If
i = i + 1
Next
repnum = strng
End Function

已经解决 哈哈 ....结贴 回复就有分
CainLai 2010-12-08
  • 打赏
  • 举报
回复
/[^\u4E00-\u9FA5a-zA-Z]/g

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧