asp正则过滤重复字符串的代码
2009-10-11 15:18
197 查看
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.pattern="(.)/1+"
str=regEx.replace(str,"$1")
Set RegEx=Nothing
Norepeat=str
End Function
'示例
s="1223445677777778aabbcccccccccc"
response.write Norepeat(s)
%>
http://www.corange.cn/archives/2008/11/2241.html
比如 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.pattern="(.)/1+"
str=regEx.replace(str,"$1")
Set RegEx=Nothing
Norepeat=str
End Function
'示例
s="1223445677777778aabbcccccccccc"
response.write Norepeat(s)
%>
http://www.corange.cn/archives/2008/11/2241.html
相关文章推荐
- asp 正则 过滤重复字符串的代码
- asp正则过滤重复字符串的代码
- asp正则过滤重复字符串的代码
- asp正则过滤重复字符串的代码
- asp 正则 过滤重复字符串的代码
- asp正则过滤重复字符串的代码
- asp正则过滤重复字符串的代码
- 运用正则表达式在Asp中过滤Html标签代码的四种不同方法
- asp.net(c#) 使用Rex正则来生成字符串数组的代码
- asp.net中利用正则表达式判断一个字符串是否为数字的代码
- asp.net(c#) 使用Rex正则来生成字符串数组的代码
- asp.net(c#) 使用Rex正则来生成字符串数组的代码
- ASP.NET过滤重复字符与字符串数组去掉重复字符串几种方法
- asp.net中利用正则表达式判断一个字符串是否为数字的代码
- C#(ASP.NET)正则表达式 过滤危险字符函数代码 防SQL注入 很全面的SQL关键字过滤
- php常用正则过滤字符串代码
- asp.net字符串通用代码
- asp.net 过滤图片标签的正则