2010-08-23 21 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 

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