网站开发与移动开发

博客园 首页 新随笔 管理

2009年10月11日 #

摘要: PHP正则校验email的代码相信好好学过PHP的人都应该知道下面这段用于eamil校验的语句,但是真正能看懂的就不多了 <?php if (eregi("^[_.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,3}$",$email)) { echo "您的 E-Mail 通过初步检查"; } ?> 在这句话里,首先是应用了一个eregi函数,这个函数还算好理解。随便找本书,就能给你一段解释: 语法: int ereg(string pattern, string string, array [regs]); 阅读全文
posted @ 2009-10-11 15:20 txf2004 阅读(144) 评论(0) 推荐(0) 编辑

摘要: asp下过滤重复字符串的代码,有时候我们需要过滤一些重复的字符串,下面的代码即可解决这个问题 比如 1223445677777778aabbcccccccccc 经过过滤之后就是12345678abc <% '过滤重复 Function norepeat(Str) Dim RegEx If IsNull(Str) Or Str="" Then Exit Function Set RegEx=New RegExp RegEx.Global = True RegEx.IgnoreCase=True RegEx.MultiLine = True RegEx.patt 阅读全文
posted @ 2009-10-11 15:18 txf2004 阅读(136) 评论(0) 推荐(0) 编辑