正则表达式(基本包含所有验证的正则)

时间:2014-07-10 07:56:35
【文件属性】:
文件名称:正则表达式(基本包含所有验证的正则)
文件大小:6KB
文件格式:TXT
更新时间:2014-07-10 07:56:35
正则表达式 正则表达式(基本包含所有验证的正则) 利用正则表达式限制网页表单里的文本框输入内容   用正则表达式限制只能输入中文:onkeyup="value=value.replace(/[^u4E00-u9FA5]/g,'') "onbeforepaste="clipboardData.setData(''text'',clipboardData.getData(''text'').replace(/[^u4E00-u9FA5]/g,''))" 一二站长网 http://www.12host.cn   用正则表达式限制只能输入全角字符: onkeyup="value=value.replace(/[^uFF00-uFFFF]/g,'') "onbeforepaste="clipboardData.setData(''text'',clipboardData.getData(''text'').replace(/[^uFF00-uFFFF]/g,''))"   用正则表达式限制只能输入数字:onkeyup="value=value.replace(/[^d]/g,'') "onbeforepaste= "clipboardData.setData(''text'',clipboardData.getData(''text'').replace(/[^d]/g,''))"   用正则表达式限制只能输入数字和英文:onkeyup="value=value.replace(/[W]/g,'') "onbeforepaste="clipboardData.setData(''text'',clipboardData.getData(''text'').replace(/[^d]/g,''

网友评论