16,554
社区成员
发帖
与我相关
我的任务
分享
Private Sub TestReg()
Dim strData As String
Dim reg As Object
Dim matchs As Object, match As Object
strData = "222223456444"
Set reg = CreateObject("vbscript.regExp")
reg.Global = True
reg.IgnoreCase = True
reg.MultiLine = True
reg.Pattern = "(\d)\1\1\1\1"
Set matchs = reg.Execute(strData)
For Each match In matchs
'Debug.Print match.Value
Debug.Print match.SubMatches(0)
Next
End Sub