Public Sub test()
Dim s As String
s = "{""Earth"":{""Fruits"":[{""name"":""Mango""},{""name"":""Apple""},{""name"":""Banana""}]}}"
PrintMatches s
End Sub
Public Sub PrintMatches(ByVal s As String)
Dim i As Long, matches As Object, re As Object
Set re = CreateObject("VBScript.RegExp")
With re
.Global = True
.MultiLine = True
.IgnoreCase = False
.Pattern = """name"":""(.*?)"""
If .test(s) Then
Set matches = .Execute(s)
For i = 0 To matches.Count - 1
Debug.Print matches(i).SubMatches(0)
Next i
Else
Debug.Print "No matches"
End If
End With
End Sub