My main quest was for these 2 lines:
Code: Select all
p := 1, m := {Len:0}
while p := RegExMatch(Haystack, 'this:"([^"]+)"' , &m, p + m.Len)
Code: Select all
~^n::
{
test:="", mtgaMatches:=[], Haystack:='blabla bla bla this:"xx" bla bla bla bla this:"xx" bla this:"yy" bla bla bla this:"zz"'
p := 1, m := {Len:0}
while p := RegExMatch(Haystack, 'this:"([^"]+)"' , &m, p + m.Len) {
if HasVal(mtgaMatches, m[1])
Continue
mtgaMatches.Push(m[1])
}
for match in mtgaMatches
test.=match
MsgBox test
}
HasVal(haystack, needle) {
for index, value in haystack
if (value == needle)
return index
if !IsObject(haystack)
throw ValueError("Bad haystack!", -1, haystack)
return 0
}
[Mod action: Moved topic from “Ask for Help (v2)”.]