I have a javascript assoc array (object) like
aa = {"(one)":["a","b","c"], "(two)":["d","e","f"]}
and a string like
s = "(two) blah blah (one) etc (two)"
I want to turn the assoc array into a plain array whose order is as specified in the string
newarray = [["d","e","f"] , ["a","b","c"], ["d","e","f"]]
The only thing is, the array and string may contain many millions of items. If I do this using string.match with the global modifier, then iterating over the results, will I end up using huge amounts of memory? Is there a way to iterate over matches in the string without storing the text of all the matches (a bit like a iterator version of string.search)?