2013年8月23日
摘要: 收集常用的正则表达式,欢迎补充。1.匹配IP地址function isIP(value){return /^((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){3}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})$/i.test(value);}复制代码2.匹配URLfunction isURL(value){return /^((http|https):\/\/(\w+:{0,1}\w*@)?(\S+)|)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/.test(valu 阅读全文
posted @ 2013-08-23 17:44 idylan 阅读(232) 评论(0) 推荐(0) 编辑