Function EingEmail(ContentStr)
Dim ClsTempLoseStr,regEx
ClsTempLoseStr = Cstr(ContentStr)
Set regEx = New RegExp
regEx.Pattern = "(.){5}"
regEx.IgnoreCase = True
regEx.Global = True
ClsTempLoseStr = regEx.Replace(ClsTempLoseStr,"*****")
Set regEx = Nothing
EingEmail = Trim(ClsTempLoseStr)
End Function
如:test13@#esli,通過正則表達後是:t**********i
字符串left/right截取就行了吧,干嘛正則。。
Function EingEmail(ContentStr)
Dim s,j
s=left(ContentStr,1)
j=len(ContentStr)-2
for i=1 to j
s=s&"*"
next
s=s&right(ContentStr,1)
EingEmail = Trim(s)
End Function
msgbox EingEmail("test13@#esli")