7,763
社区成员
发帖
与我相关
我的任务
分享
Dim SendFilePath2(20) As String
Dim iPath As Byte
Dim iiPath As Byte
Dim iiiPath As Byte
iiPath = 1
iiiPath = 0
For iPath = 0 To Len(SendFilePath)
If Mid(SendFilePath, iPath, 5) = "#and#" Then
SendFilePath2(iiiPath) = Mid(SendFilePath, iiPath, iPath - iiPath)
iiPath = iPath + 5
iiiPath = iiiPath + 1
End If
Next
Private Sub TestReg()
Dim strData As String
Dim reg As Object
Dim matchs As Object, match As Object
strData = "a-bcd-4324-f23"
Set reg = CreateObject("vbscript.regExp")
reg.Global = True
reg.IgnoreCase = False
reg.MultiLine = True
reg.Pattern = "(.+?)(?:-|\b)"
Set matchs = reg.Execute(strData)
For Each match In matchs
'Debug.Print match.Value
Debug.Print match.SubMatches(0)
Next
End Sub