say my data looks like this:
name=peter
age=40
id=99
I can create a regex
(\w+)=(\w+)
To match name, age, and id into group1, and peter, 40, 99 into group two. However, I want to iterate and even selectively iterate through these groups. E.g.,
I want to do different processing if the group1 value is id. So the algorithm is like
//iterate through all the group1, if I see group1 value is "id", then I assign the corresponding group2 key to some other variable. E.g., newVar = 99
The second thing I want to do is to just jump to the third instance of the matching group1 and get the key "id" out instead of iterating.