28,391
社区成员
发帖
与我相关
我的任务
分享
a = "3-2-1"
b = split(a,"-")
' ---------------------
a = "1,2-3/4_55=66"
b = ExpStr(a,"[\d]+","$$")
Function ExpStr(vStr,vReg,sStr)
Dim Re,Matchs,Item,tStr
tStr = ""
Set Re = New RegExp
Re.Pattern = vReg
Re.IgnoreCase = True
Re.Global = True
If Re.Test(vStr) Then
Set Matchs = Re.Execute(vStr)
For Each Item In Matchs
tStr = tStr & Item.Value & sStr
Next
tStr = Split(Left(tStr,Len(tStr) - Len(sStr)),sStr)
End If
Set Re = Nothing
ExpStr = tStr
End Function