7,763
社区成员
发帖
与我相关
我的任务
分享
Dim s As String
Dim re As RegExp
Dim mh As Match
Dim mhs As MatchCollection
s = "I'm singing while you're dancing."
Set re = New RegExp
re.Global = True
re.Pattern = "\b\w+(?=ing\b)"
If re.Test(s) = True Then
Set mhs = re.Execute(s)
For Each mh In mhs
Debug.Print mh.Value
Next
End If
结果:
sing
danc