欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

asp 正則 過濾重復字符串的代碼

 更新時間:2009年10月12日 15:13:42   作者:  
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)
%>

相關文章

最新評論