function Repnum (STRNG) ' returns as an array
i = 0
Set regex = new RegExp
Regex.pattern = "(d+)" "[0-9]"
Regex.ignorecase = True
Regex.global = True
Set matches = Regex.execute (strng)
For the match in matches
' Retstr = retstr & <br> ' & Match.value
If Len (match.value) >=5 Then
STRNG = replace (strng, right (match.value,4), "* *")
End If
i = i + 1
Next
Repnum = strng
End Function
Use the time directly <%=repnum (content)%> on the line, the result is the content string of some numbers are replaced by * * *, play a role in the hidden contact. If you think you left a lot of numbers, change the corresponding number within this function.
and add a related function.
Feature: ASP tutorial The regular expression extracts all the digits in a string.
Parameter: strng for content to extract
function regexptest (strng) ' return with array
i = 0
Set Regex = new RegExp
regex.pattern = "(d+)" ' [0-9] "
regex.ignorecase = true Regex.global = True
Set matches = Regex.execute (strng)
& nbsp For the match in matches
retstr = retstr & "<br>" & Match.value ' output extracted from the number
i = i + 1
next
& nbsp; regexptest = Retstr
End Function
uses method <%=regexptest (content)%>, the run result is all the numbers in the content string, and wraps.