Referring to this question.
How to iterate for each key like:
For k = 1 To 40
If allThings(k) <> "" Then
Dim rsp As String, ptrn As String, i As Long, arr()
rsp = [A1]
ptrn = "" + allThings(k) + """:(\d+[^,])""" 'guid,name,ispool,...
arr = GetMatches(rsp, ptrn)
For i = LBound(arr) To UBound(arr)
MsgBox arr(i)
Next
End If
Next
As follows, just for the concatenating in new search word into the regex.
You might want to swop the regex line (depending on what characters can appear to something like
GetMatches(s, arr2(j) & """:(""?[A-Za-z0-9]+[^,])")
Regex - Try it here
Example with
name
1st Capturing Group
("?\w+[^,])
"?
matches the character " literally (case sensitive)?
Quantifier — Matches between zero and one times, as many times as possible, giving back as needed (greedy)\w+
matches any word character (equal to[a-zA-Z0-9_]
)+
Quantifier — Matches between one and unlimited times, as many times as possible, giving back as needed (greedy)Match a single character not present in the list below
[^,]
,
matches the character , literally (case sensitive)Results: