4月27
asp过滤电话、手机、qq号码函数,asp正则表达式过滤字符串中的电话号码/qq等数字
用处过滤文章、留言、评论处的广告手机,电话,QQ等
Function RegExpTest(strng) '以数组返回
i = 0
Set regEx = New RegExp
regEx.Pattern = "(\d+)" '"[0-9]"
regEx.IgnoreCase = True
regEx.Global = True
Set Matches = regEx.Execute(strng)
For Each Match in Matches
RetStr = RetStr &"<br>"& Match.Value '输出提取出来的数字
i = i + 1
Next
RegExpTest = RetStr
End Function
asp正则表达式屏蔽字符串中的email地址
Function repmail(strng) '以数组返回
i = 0
Set regEx = New RegExp
regEx.Pattern = "[a-zA-Z0-9]+@([a-zA-Z0-9]+\.)+[a-zA-Z0-9]+"
regEx.IgnoreCase = True
regEx.Global = True
Set Matches = regEx.Execute(strng)
For Each Match in Matches
'RetStr = RetStr &"<br>"& Match.Value
If Len(Match.Value)>=5 Then
strng = Replace(strng, left(Match.Value,5),"***")
End If
i = i + 1
Next
repmail = strng
End Function
最后编辑: tommyhu 编辑于2010/04/27 10:52
用处过滤文章、留言、评论处的广告手机,电话,QQ等
Function RegExpTest(strng) '以数组返回
i = 0
Set regEx = New RegExp
regEx.Pattern = "(\d+)" '"[0-9]"
regEx.IgnoreCase = True
regEx.Global = True
Set Matches = regEx.Execute(strng)
For Each Match in Matches
RetStr = RetStr &"<br>"& Match.Value '输出提取出来的数字
i = i + 1
Next
RegExpTest = RetStr
End Function
asp正则表达式屏蔽字符串中的email地址
Function repmail(strng) '以数组返回
i = 0
Set regEx = New RegExp
regEx.Pattern = "[a-zA-Z0-9]+@([a-zA-Z0-9]+\.)+[a-zA-Z0-9]+"
regEx.IgnoreCase = True
regEx.Global = True
Set Matches = regEx.Execute(strng)
For Each Match in Matches
'RetStr = RetStr &"<br>"& Match.Value
If Len(Match.Value)>=5 Then
strng = Replace(strng, left(Match.Value,5),"***")
End If
i = i + 1
Next
repmail = strng
End Function
最后编辑: tommyhu 编辑于2010/04/27 10:52

爱与痛的边缘
每隔一段时间执行一次的网页的代码





