2010-08-23 60 views

回答

0

据我所知,你将不得不通过连续调用做到这一点,以取代

result = "a1b2c3d4e567" 
result = replace(result,"a","") 
result = replace(result,"b","") 
result = replace(result,"c","") 

3

如果你的目标是消除所有非数字字符,下面的工作:

' Added reference for Microsoft VBScript Regular Expressions 5.5 

Const s As String = "a1b2c3d4e567" 
Dim regex2 As New RegExp 
Dim a As String 

regex2.Global = True 
regex2.Pattern = "[^0-9]" 
Dim a As String = regex2.Replace(s, "") 

MsgBox (a) ' Outputs 1234567 

如果您正在查找特定字符,请更改该模式。